using the loop on a page
To use template tags within a foreach loop outputting the results of get_posts, use the function setup_postdata() to populate the global $post with the data it needs. To style the first post differently, use a counter to keep track of which post you’re outputting. After finishing output, use wp_reset_postdata() to restore the $post global. wp_reset_query … Read more