Skip to content

Instantly share code, notes, and snippets.

@filipecrosk
Created July 2, 2013 19:30
Show Gist options
  • Save filipecrosk/5912353 to your computer and use it in GitHub Desktop.
Save filipecrosk/5912353 to your computer and use it in GitHub Desktop.
<div class="itens">
<?php
$x=0;
$query = new WP_Query( 'cat=3' );
$total = $query->post_count;
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
if ( $x == 0 ) {
?>
<div class="item">
<ul>
<?
}
?>
<li>
seu conteudo
</li>
<?php
$x++;
$y++;
?>
</ul>
<?php
if ($x > 9 || $y == $total ) {
$x=0;
?>
</ul>
</div>
<?
}
}//while
}//if
?>
</div> <!--itens-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment