Now-Reading Tweaks v2
Posted by | Filed under Plugins, Software, WordPress
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.
Similar Posts
- Now-Reading Tweaks
I use Rob Miller's excellent Now-Reading plugin to track all the books I've read and am reading here ... - Author Pages with hCard & jQuery
While I'm definitely not the designer that any of the people who created these beautiful hCards, I w ... - Text-Link-Ads Updated
Text-Link-Ads is a nice service which I use to help pay the bills for running this site. They just r ... - Dashboard Akismet Hack 0.0.3
Akismet is a popular comment, trackback, pingback spam blocker. Originally it was developed for the ... - Fixing Now-Reading’s Admin Menu
I like using Now-Reading to track what books I'm currently reading, have read and want to read on my ...















March 17th, 2010 at 8:00 am
Thank you so much for this post!
I just installed the forked version of Now Reading from the WordPress repository and the only thing that was broken from my old custom templates was this function (didn’t exist) so I added it and now I have my Amazon search capabilities back and my grand custom template.
Thanks!
March 17th, 2010 at 8:01 pm
Glad I could help!