A
A
Aleksander9112020-06-03 16:09:02
WordPress
Aleksander911, 2020-06-03 16:09:02

How to display announcements according to the given parameters?

Good day everyone.
There is a usual output of category anans 3 in a row
category.php

<div class="row">
<div class="news_block">
    <h1 class="article-headline__title"><?php printf( __( '%s', 'trudslovo' ), single_cat_title( '', false ) ); ?></h1>
  <div class="row category-grid">
       <?php while ( have_posts() ) : the_post(); ?>					
       <?php get_template_part('content') ?>						
       <?php endwhile; ?>
     </div>
  </div>
</div>


content.php
<div class="column-content col-4">
  <div class="column-content__one">
    <a class="image" href="<?php the_permalink(); ?>">
      <?php the_post_thumbnail( 'category-thumb', array( 'class' => 'category-thumb' ) ); ?>
    </a>	
    <div class="column-content__item">	
      <h3><a class="header" title="<?php printf( esc_attr__( '%s', 'striped' ), the_title_attribute( 'echo=0' ) ); ?>" href="<?php the_permalink(); ?>">
      <?php the_title(); ?>
      </a></h3> 
    </div>
  </div>
</div>

Tell me, how can I make the output of 3 articles alternate (each article is displayed in a block using col-4) with the output of articles of 4 (displayed using col-3 )?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question