Hello!

global $product, $woocommerce_loop; if ( empty( $woocommerce_loop['loop'] ) ) { $woocommerce_loop['loop'] = 0; } if ( ! $product || ! $product->is_visible() ) { return; } $woocommerce_loop['loop']++; $shop_style = yp_opts('shop_style')=='row'?'row':'grid'; ?> <div <?php post_class( $shop_style=='grid'?'item col-lg-4':'' ); ?>> <?php if($shop_style == 'grid') : ?> <div class="game-card" style="background-image: url(<?php the_field('game-card-fon');?>);"></div> </div> 

There is such a piece of code, it displays a list of all products, how to make it so that after every 6 products, another div appears with a picture for example?

    1 answer 1

    Make a variable. Increment at each iteration of the loop. When the variable is 6 (make if), output a picture and reset the variable. And it will again add the number. When it reaches 6, it will display the picture again. And so it all over again.