• Hey, I would like to list the last 3 posts with XY tag and with thumbnail image. How is it possible? What’s wrong with my code? Thanks

    <?php
            global $post;
                // The Query
    			$args = array( 'numberposts' => 3, 'tag'=> 'XY' );
                query_posts($args);
    
                // The Loop
                while ( have_posts() ) : the_post();
                    echo '<li>';
                    the_title();
                    echo '</li>';
    				echo get_the_post_thumbnail($post->ID, 'thumbnail');
                endwhile;
    
                // Reset Query
                wp_reset_query();
    
            ?>
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Show last 5 posts with tag XY and with first image in the post’ is closed to new replies.