Сделала 2 цикла
<?php $count = 0; ?>
<?php if ( have_posts() ) : ?>
<?php echo "<div>Категория 1</div>"; ?>
<?php /* Start the Loop */ ?>
<?php query_posts('cat=3'); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
if($count == 0)
echo "<div class='row'>" ;
elseif($count%3 == 0)
echo "</div><!--.row--><div class='row'>";
get_template_part( 'content', 'grid4' );
$count++;
?>
<?php endwhile; ?>
<?php echo "</div><!--.row-->"; ?>
<?php $count = 0; ?>
<?php echo "<div>Категория 2</div>"; ?>
<?php /* Start the Loop */ ?>
<?php query_posts('cat=1'); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
if($count == 0)
echo "<div class='row'>" ;
elseif($count%3 == 0)
echo "</div><!--.row--><div class='row'>";
get_template_part( 'content', 'grid4' );
$count++;
?>
<?php endwhile; ?>
<?php echo "</div><!--.row-->"; ?>
Все работает, но корректно ли это?