Tag Archives: WordPress

Updating VectorLover Theme

I’ve been posting notes about this under New Look, but figured all the changes deserved their own post. Since I’m going to keep updating this post with new information until I decide not to, I’m marking this as a sticky post and hiding the real changes below the fold. Additional note: I’m doing the vast majority of this work over at my devblog, so it may be some time until the changes show up here.

UPDATE: I’ve removed the sticky setting from this post, as I’ve completed all the work I intend to do for now on this theme. Lastly, I’ve setup a page where any new information on VectorLover2 will be released and I will be posting a zip file of VL2 there for people interested in my version of the theme.

Continue Reading

New Look

Upgraded CoffeeBear.net to WordPress 2.7 and switched to a different theme.  I liked certain things about the old theme but most of those were developer features that I’ve never gotten around to using.  And since it was kind of ugly the way it was…  I decided to switch it up a bit.  Unfortunately I’ll have to once again customize the Now-Reading output as it’s all busted & fugly right now.

Now-Reading Tweaks v2

Some time back, I tried to make Rob Miller’s Now-Reading plugin display who’s reading each book on the individual pages. But the PHP code I posted at that time didn’t work like I thought it did, my interests changed and I moved onto other things. Today I had a visitor stop by asking about my broken tweak. So I took another look at the code and I believe I’ve got something that works this time.

// Now-Reading Plugin: Get the display name of the book's reader
function mlm_book_reader( $echo=true ) {
	global $book;

	$user_info = get_userdata($book->reader);
	
	if ( $echo )
		echo $user_info->display_name;
	return $user_info->display_name;
		
}

This grabs “Display name publicly as” from the user’s profile and displays it on the page. I put the function in the functions.php file of the theme I’m using (so any automatic upgrades of the plugin won’t erase it). Then I put < ?php mlm_book_reader() ?> into my custom single.php template and viola!

Note: this has only been tested on WordPress 2.6.2 with Now-Reading 4.4.3.

Quick Note

Just upgraded CoffeeBear.net to WordPress 2.6. So this post is partly to make sure all my plugins are working correctly with it.

I’d also like to take a momemt to thank AWelkin & Bryon for the gifts they brought back from Japan for me. I’ve now decorated my cubicle with 3 Tachikoma gashapon. *yeah!* Also a quick thanks should go out to my buddy/ex-coworker Eric, he mentioned more than once I just needed the right motivation to get into programming1.  Well I recently had some slow time at work and wanted a way to parse some badly formatted data; so I wrote a Python script and while doing so certain things that have never clicked in my head about programming started falling into place.  I’ve since started working on another Python script for a different project at the office, so perhaps there’s some hope for my coding-fu yet.

1 I do a lot of computer stuff, but have never been much of a programmer.  Usually I just learn enough to hack somebody else’s stuff together to do what I want in rather ugly hacks.

Now-Reading: Default Filters on Book-Meta

Ever since upgrading to the latest version of Rob Miller’s Now-Reading plugin, I noticed my single book pages were working but not displaying everything correctly. Specifically books I’d marked having been borrowed from my local library were being displayed as:

  • I borrowed this book fromlibrary

When they should simply have a line reading “I borrowed this book from my local library”. I had spent much
time fiddling with my templates trying to figure out how the upgrade broke them and today I figured it out. The truth is my template was just fine. The problem is the newer version of Now-Reading was applying a new filter to book-meta1. That filter is wpautop and it was wrapping my variable in <p> … </p> tags. Those tags screwed up the display and made my variable checks fail. To correct the problem, I went into now-reading/default-filters.php and commented out add_filter('book_meta_val', 'wpautop');. Now my single book pages look like they’re supposed to again. Yeah!

1 This is a custom field available in the back-end of the plugin and it is where I store the information telling my template if I borrowed the book and from whom I borrowed it.

Copyright © 2004 – 2020 CoffeeBear.net. Powered by WordPress.