Apply a style for 4 blogs and another style for the next 4 blogs in wordpress blog page?
In the following code you could add a class specifically based on the position in the loop: <?php /* Start the Loop */ $i = 1; $class=”first-class”; while ( have_posts() ) : the_post(); if($i % 4 == 0){ $class=”second-class-“.+$i; } echo ‘<div class=”‘.$class.'”>’ get_template_part( ‘template-parts/content’, get_post_format() ); echo ‘</div>’ $i++; endwhile; ?> This is essentially … Read more