Good day! Help make a conclusion of headings and the latest news from each heading.

What I have now:

<div class="row"> <?php query_posts('posts_per_page=3&caller_get_posts=1'); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class="col-lg-4"> <div class="category-post-img" style="background:url(<?php echo catch_that_image(); ?>) no-repeat; background-size:cover;"> <div class="category-tumb"> <div class="category-romb"> <div style="background:url(<?php echo catch_that_image(); ?>) no-repeat; background-size:cover; transform: rotate(45deg);width: 200%;height: 200%; position:relative; left:-40px; top:-40px;"> </div> </div> <div class="category-romb-img"> </div> </div> <div class="category-img-text"> <h1><?php the_category(' '); ?></h1> <div class="category-img-text-sep"> </div> <h2><?php echo get_the_date(); ?></h2> </div> </div> <div class="category-post"> <div class="category-text"> <h1><?php the_title(); ?></h1> <p> <?php the_excerpt(); ?> </p> <div class='category-text-sep'></div> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">Подробнее</a> </div> </div> </div> <?php endwhile; else: ?> <?php endif; wp_reset_query(); ?> </div> 

That is, the first 3 posts are now displayed. It is necessary that the last posts are displayed one by one from each rubric and every 3 posts <div class="row"></div> repeated with the next 3 posts inside. Those. The number of posts should be equal to the number of categories.

    0