• Hi everyone – I’m trying to list the most recent posts with their corresponding post_thumbnails() images… I got it working with:

    <div class="recent_thumbs">
    <h1>Posts you might have missed</h1>
    <?php
    global $post;
    $the_newest = get_posts('numberposts=8');
     ?>
    <?php foreach($the_newest as $post) :
    setup_postdata($post);	?>
    <div class="post">
    <div class="recent_thumbs_image"><a href="<?php the_permalink() ?>"><?php the_post_thumbnail('list-post-thumbnail'); ?></a></div>
    <h2 class="posttitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    
    </div>
    <?php endforeach; ?>
    
    </div>

    But now the comments for each post (i’m calling them from the sidebar.php template) are the same!

    Is there any other way to list the recent post_thumbnails in the format i’ve defined in functions.php?

    Any help much appreciated!

    -Alex

The topic ‘Listing recent post_thumbnails’ is closed to new replies.