• I have the code below to list the lastest posts on a page outside the content area. I am trying to add the post image to each one aswell but cant seem to get this correct. I just want a small image on each post line.

    <?php
        $args = array( 'numberposts' => 6, 'post_status'=>"publish",'post_type'=>"post",'orderby'=>"post_date");
        $postslist = get_posts( $args );
        foreach ($postslist as $post) : setup_postdata($post); ?>
           <div class="events">
                 <p><strong><?php the_date(); ?></strong></p>
               <p><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" target="blank" ><?php the_title(); ?></a></p>
          </div><br>
    <?php endforeach; ?>

    Many thanks

Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘adding post image’ is closed to new replies.