Please note the extra spaces in the code quoted below, you need to removed these to get it to work.
Here's an email I had recently and my response, hopefully it'll be useful for others:
I've downloaded and installed the book review plugin, but am a little confused by the docs.
The "Write Book Entry" option appears, and I've written my first review, but none of the meta info appears, and the docs' suggestion of using eg:
$variable = get_book_image(post_ID*);
echo "< img src=\"$variable\" />";
fails, since this just results in the raw PHP code appearing in the post. Do I have to create a special template for posts in the 'Books' category? How would I do this?
My response:
First off, the best way to check if the plugin has been adding the meta data it to head to the manage posts page of the Admin section and hit the edit link at the end of the row. Switch to the Advanced editing mode if you're not already in it and scroll down, you should see a selection of meta data fields with the information you entered. If you didn't, something's wrong.
Assuming the data is in there the tags should work and, as you rightfully pointed out, you need to add the new tags to your template file (index.php, single.php, if you have one, and possibly archive.php).
Typically I'd suggest looking for the line containing:
< ?php the_content(); ?>
And add the following before it:
< ?php
if (in_category(%)) {
$variable = get_book_image($id);
echo "< img src=\"$variable\" />";
}
?>
The % sign needs to be replaced by the category ID for whatever category you're using for books (you can find this number by going to the Manage, then the Categories screen in the Admin section. The number on the left of the row is the category ID.
You may want to put:
echo "< img src=\"$variable\"
style=\"float:left;margin:5px\" />";
This will make the image appear on the left and have the text wrap around it.
Hope that helps.
