How to reverse post layout after every 2 posts?

enter image description here

HTML:

<div class="products-section">
    <div class="row">
        <div class="col-md-4">
            <div class="single-product-small">
                <a href=""><h2>Yoga Strap</h2></a>
                <p>$11.99</p>
                <img src="<?php echo get_template_directory_uri();?>/images/prodact.png" alt="" />  
            </div>
        </div>
        <div class="col-md-8">
            <div class="single-product-big">
                <a href=""><h2>Yoga Strap</h2></a>
                <p>$11.99</p>
                <img src="<?php echo get_template_directory_uri();?>/images/product2.png" alt="" /> 
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-8">
            <div class="single-product-small">
                <a href=""><h2>Yoga Strap</h2></a>
                <p>$11.99</p>
                <img src="<?php echo get_template_directory_uri();?>/images/product2.png" alt="" /> 
            </div>
        </div>
        <div class="col-md-4">
            <div class="single-product-big">
                <a href=""><h2>Yoga Strap</h2></a>
                <p>$11.99</p>
                <img src="<?php echo get_template_directory_uri();?>/images/prodact.png" alt="" />  
            </div>
        </div>
    </div>
</div>

Read more here:: How to reverse post layout after every 2 posts?

Leave a Reply

Your email address will not be published. Required fields are marked *