• Hi I’m trying to output a list of posts within a certain category with an image above the title, here’s where I am:

    <?php
     global $post;
     $myposts = get_posts('category=this_months_news');
     foreach($myposts as $post) :
    		the_attachment_link( 13, false, array(48, 48));
    
     ?>
       <li><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
     <?php endforeach; ?>

    I’ve added this to the sidebar as a menu. It’s showing the post titles as links but says ‘missing attachment’ where the image should be?

    Can anyone tell me what I’m doing wrong please?

The topic ‘List of posts with thumbnails’ is closed to new replies.