WordPress.org

Ready to get started?Download WordPress

Forums

easily specifying the posts divider image? (4 posts)

  1. candyaddict
    Member
    Posted 8 years ago #

    You know how some themes have a divider image at the bottom of each post? (for an example, see Connections at http://playwith.wpthemes.info/index.php?wptheme=Connections)
    I want to be able to have multiple divider images and control which one is used for each post.

    I tried using a rotate PHP script and that works to rotate the images, but I was thinking I would like ot control which image shows up by maybe adding a special tag at the bottom of each post - something like:
    <?php img_divider("chocolate"); ?>
    and that gets replaced by some HTML that shows the chocolate image.

    I was thinking it could be done autonatically based on the category of the post but then I wasn't sure how to handle the case where a post is in multiple categories.

    Has this been done in a plugin already and if so, which one? If it hasn't been done, can anyone point me in the right direction to making this work?

    Thanks!
    Brian
    http://candyaddict.com
    http://myvogonpoetry.com

  2. moshu
    Member
    Posted 8 years ago #

    I was thinking it could be done autonatically based on the category of the post

    That was the moment you could have searched for
    http://search.wordpress.org/category+images

  3. candyaddict
    Member
    Posted 8 years ago #

    That's close, but not quite what I want. I want a single "category" image at the bottom of each post - a divider image. If it were done automatically, it would need some logic that would help it choose just one image out of the potentially many categories that the post was posted to.

    It may be easier to just have a special tag I put in the bottom of each post to specify which image to use. So when I put his at the bottom of a post:
    <?php img_divider("chocolate"); ?>

    It gets translated to something like:

    <center>
    <img src=/blog/images/dividers/chocolate.jpg'>
    </center>

    Make sense?

    brian
    http://candyaddict.com

  4. moshu
    Member
    Posted 8 years ago #

    To be able to use something like you posted
    <?php img_divider("chocolate"); ?>
    you need to write that function.

    On the other hand there is a Top Category plugin that helps to pick one "main" category for posts posted in multiple categories - maybe the plugin could work with the category image stuff. Maybe not, I don't know.

    If you are not using the keywords feature, that could be another way to deal with it.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags