• Hi all,

    I would like to have one category that essentially works as a photoblog, although all I really will be doing will be creating normal posts and inserting an image that goes along with the text.

    What I want to do is have a section on my main page that contains, say, the 4 latest posts but the links to each of these posts would be a thumbnail of the image used in the post.

    Does anyone know how I would go about doing something like this (if indeed it is possible!).

    Many thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Will all posts work like this? If so, then here’s a tiny bit of a hack, but how I would do it:

    Enter the <img> to the thumbnail image in the excerpt field.

    In The Loop of your index template, use some form of the following for the content portion:

    <?php if($single) {>
    <?php the_content(); ?>
    <?php } else { ?>
    <a href="<?php the_permalink(); ?>"><?php the_excerpt(); ?></a>
    <?php } ?>

    Thread Starter exbionic

    (@exbionic)

    Hi Kafkaesqui (good name!),

    Thanks for your reply. All posts in this particular category will work like this, but only this category. On my index I will have the latest post from my ‘main’ category and thought it would be nice if I could create a ‘highlights’ section for the category that deals with photos, using the thimbnails of the photos as links.

    I’m not savvy enough with PHP to know exactly what you are suggesting, but I would have thought that if it involves editing the loop that it must affect all posts in all categories. Is that right?

    Thanks again for your reply. I give what you suggested a go and see what I come up with.

    Cheers.

    “Hi Kafkaesqui (good name!)”

    Thanks. Took me a long while to get used to it…

    “All posts in this particular category will work like this, but only this category.”

    Hmm. You’re right that my bit of code would hit posts from every category. For what you’re looking to accomplish (and if I read you correctly, it’s to create a separate loop for your “particular” cateogry) , there’s a number of possible ways to go at it. When using 1.2.x, I’d recommmend looking at a plugin called Show Categories. You can find the zip file for it here:

    https://mookitty.co.uk/devblog/downloads/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Thumbnail images used as links to posts’ is closed to new replies.