• Howdy everyone,

    How can i make a box to show a list of 5 posts from a category and display the featured image(or any) from the first post in the list?

    This is the code that i use.Its lists my post correctly.

    <div class="bottomBox">
    <h6>reviews</h6>
    <ul>
    <?php
    global $post;
    $args = array( 'numberposts' => 5, 'offset'=> 1, 'category' => 1 );
    $myposts = get_posts( $args );
    foreach( $myposts as $post ) :	setup_postdata($post); ?>
    	<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
    </ul>
    </div>

    How can i make it display an image below ‘reviews’?

  • The topic ‘Creating a category list with image of first post’ is closed to new replies.