Viewfinder Design Support Forum » Downloads

Book Review Plugin Q&A

(6 posts)
  • Started 10 years ago by lee
  • Latest reply from lee
  • This topic is not resolved

  1. 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.

    Posted: 2005-11-19 10:40:38 #
  2. spiderlake
    Inactive

    Sorry for my ignorance but if I read the answer above correctly, I need to add the specific functions to my index, single post and archive files? Using the default template in WP 2.0, I am having a devil of a time getting the metadata (images, link URL, author, etc) to display in the post. The metadata fields populate with the correct values but the data does not appear in the post. Any help would be greatly appreciated.

    Posted: 2006-03-24 20:02:37 #
  3. somedude
    Inactive

    FYI
    s/get_book_image($id)/br_get_book_image($id)

    Posted: 2006-03-30 10:38:04 #
  4. What somedude means is that the functions have changed names from my original post and you need to add br_ to many of the function names, so get_book_image() becomes br_get_book_image().

    Check out the read me file in the download for a full list of the function names. Simply add them into your WP templates where you want them to appear.

    Posted: 2006-04-10 17:58:59 #
  5. How can I turn on the comment? Thanks.

    Posted: 2006-09-27 14:53:16 #
  6. Have you put the link to the comments form in the template you call the plugin from?

    Posted: 2006-10-14 11:11:28 #

RSS feed for this topic

Reply

You must login to post.