Created
February 13, 2014 21:37
-
-
Save emaildano/8984357 to your computer and use it in GitHub Desktop.
Asymmetrical post query.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$args = array( 'post_type' => 'video', 'posts_per_page' => 10,); | |
$the_query = new WP_Query( $args ); | |
echo '<section id="our-work">'; | |
if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); | |
$counter += 1; | |
if ($counter == 1 || $counter == 4 || $counter == 6 || $counter == 9) { | |
echo '<div class="row">'; | |
} | |
if($counter == 4 || $counter == 5 || $counter == 9 || $counter == 10) : | |
echo '<div class="span6">'; | |
the_post_thumbnail(); | |
echo '</div>'; | |
else: | |
echo '<div class="span4">'; | |
the_post_thumbnail(); | |
echo '</div>'; | |
endif; | |
if ($counter == 3 || $counter == 5 || $counter == 8 || $counter == 10) { | |
echo '</div>'; | |
} | |
endwhile; endif; | |
echo '</section>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment