• First off the code:

    <?php query_posts('showposts=5'); ?>
    <?php $posts = get_posts('numberposts=5&offset=1');
    foreach ($posts as $post) : start_wp(); ?>
    <?php echo "<a href='",the_permalink(),"'>",get_the_excerpt($fakeit = false),"</a>"; ?>
    <?php endforeach; ?>

    I’ve got a photoblog at http://www.29twelve.com which simply shows a photo (post) at a time, it’s all very simple. I use Custom query string to show 1 post on the home page with subsequent pages also showing 1 photo.

    I want add the previous 5 thumbnails (excerpts) underneath my current photo using a second loop, the code I’ve written is above. This works fine in index.php but I also use single.php and the code doesn’t work in this page as it still shows the last 5 thumbnails relating the my latest photo and not the one that’s displayed on the page.

    I think I must be able to add a simple count but my php is sufficiently limited that I’m not sure where to start. Any ideas??

    Thanks in advance.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Second loop excerpt question………’ is closed to new replies.