Least Number of Loops to Create Custom Homepage?
You can achieve this by checking where you are in the loop and outputting markup at the appropriate time. Within the object that holds the query results is a counter that keeps track of the current post, $wp_query->current_post. Note that it is zero-indexed, so first is 0, 2nd is 1, etc.. <?php while( have_posts() ): … Read more