Categories

Archives

“Now Reading” – tweaks

Today I was fiddling with yet another plugin: Now Reading by Rob Miller. Install it, add a line of code to your sidebar and add a few books and it will show you the books you’ve read, are reading or want to read in the sidebar. I had two issues with the plugin, both of which I fixed by adding or deleting php code (I’m getting rather good at this, tweaking a blog is fun!).

The first was with displaying pictures of the bookcovers in the sidebar, which Now Reading only does for current books. I don’t want to overcrowd my sidebar, so I wanted to get rid of the pictures. There’s no option for that in the admin menu, so I decided to hack the php file. In the file sidebar.php I replaced the lines

<p><a href="<?php book_permalink() ?>"><img src="<?php book_image() ?/>" alt="< ?php book_title() ?>" /></a></p>
<p><strong>< ?php book_title() ?></strong> by < ?php book_author() ?></p>

with the line

<li><a href="<?php book_permalink() ?>">< ?php book_title() ?></a> by < ?php book_author() ?></li>

This got the right result: the bookcover will only be shown when you click on the title and see the entry for it.

The other thing I found irritating was that I really had no idea how many entries the sidebar would finally show. As I just said, I don’t like my sidebar too cluttered, so I wanted only two entries per category shown. In the same file, therefore, I added a few arguments to the lines that call the entries, in which I indicate I want two books per category, and for read books I want them in descending order, whereas for current and planned books I want them random:

For planned books: <?php if( have_books('status=unread&orderby=random&num=2') ) : ?>
For current books: <?php if( have_books('status=reading&orderby=random&num=2') ) : ?>
For read books: <?php if( have_books('status=read&orderby=finished&order=desc&num=2') ) : ?>

There should be options for these things (even though I feel proud for fixing it this way), so I’ll request these features. Maybe Rob Miller will want to implement them :)

2 comments to “Now Reading” – tweaks

  • Haha, I didn’t figure you’d come visit!
    It’s a good thing these things are not that difficult to tweak (I mean, I have relatively little clue) so I’m not complaining, but maybe some people wouldn’t be able to figure it out if it’s not an option in the admin menu. Then again, maybe those people should use an altogether ‘easier’ (but not as tweakable) interface for their blogs ;)

    And indeed, I like the plugin… now to stuff it with books! :)

  • rob

    That’s what the templates are for, heh—that’s not hacking the plugin, it’s just customising the templates as is encouraged and indeed typically necessary.

    Having options for the vast amount of things you can do by editing the templates would be rather unwieldy, I think!

    Glad you like the plugin, though :)

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>