WP_Query how to add a thumbnail to the first post from the last 5 posts?
Because you’re not specifying order and orderby parameters within your WP_Query query, the latest added post will be shown in the first place. Having that in mind, you can do the following: <ul> <?php $the_query = new WP_Query( array( ‘cat’ => ‘1’, ‘posts_per_page’ => 5 ) ); ?> <?php $iterator = 0; ?> <?php while … Read more