wordpress loop php code example

Example: wordpress loop first two post

current_post == 0 ) { //open wide column wrapper div// ?> current_post <= 1 ) { get_template_part( 'content', 'featured' ); //insert large post// ?> current_post == 1 || $wp_query->current_post <= 1 && $wp_query->current_post == $wp_query->post_count-1 ) { //close wide column div// ?> current_post == 2 || $wp_query->current_post <= 1 && $wp_query->current_post == $wp_query->post_count-1 ) { //open narrow column wrapper div// ?> current_post >= 2 ) { get_template_part( 'content', 'featuredside' ); //insert small post//?> current_post == 4 || $wp_query->current_post == $wp_query->post_count-1 ) { //close narrow column div// ?>

Tags:

Misc Example