enter image description here

How can I create a full-width post every 4 post grids? As in the following picture.

Here is my code wordpress loop.

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    <article id="post-<?php the_ID(); ?>" <?php post_class('col-sm-6 grid-item '); ?>>

        <div class="entry-image">
            <a href="<?php echo get_permalink() ?>"><?php the_post_thumbnail('grid-thumb'); ?></a>
            <?php unbranded_entry_footer(); ?>
        </div>

        <header class="entry-header">
            <?php
            the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );

            if ( 'post' === get_post_type() ) : ?>
            <div class="entry-meta">
                <?php unbranded_posted_on(); ?>
            </div><!-- .entry-meta -->
            <?php
            endif; ?>
        </header><!-- .entry-header -->

        <div class="entry-content">
            <p><?php echo unbranded_string_limit_words(get_the_excerpt(), 18); ?>&hellip;</p>
        </div><!-- .entry-content -->
    </article>

<?php endwhile; endif; ?>

Read more here: Create a full-width post every 4 post grids – WordPress Loop


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: