query_vars['posts_per_page'])){
$limit = $wp_query->query_vars['posts_per_page'];
}else{
$limit = 10;
}
$all_posts = $wp_query->post_count;
$i = 1;
$j = 1;
/* Start the Loop */
while (have_posts()) : the_post();
if ( $i == 1 && $category_template=='loop-2columns') {
echo '
';
}
/* Include the post format-specific template for the content. If you want to
* this in a child theme then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part( 'content', $category_template);
if($category_template=='loop-2columns'){
if ( $i % 2 == 0 || $j == $limit || $j == $all_posts ) {
echo '
';
$i = 1;
}
else {
$i ++;
}
$j ++;
}
endwhile;
?>