Hello @Bas Kling,
Could you please provide us with more details? Would you like to add a static block inside the product loops (shop and category archives)? Where exactly should this block be placed? Are you using the XStore Archive Products Builder or the default template for the product archive page?
Please also provide us with temporary wp-admin access so that we can assist you further if needed. (This option is not available in the Theme Options, but you can try the following solution added in your child-theme/functions.php if you are using the builder-based template.)
add_action('etheme_product_grid_list_after_product_item', function() {
global $woocommerce_loop;
$repeat_banner_each_x_product = 5; // Display banner after every 5th products
if (($woocommerce_loop['loop'] % $repeat_banner_each_x_product) == 0) {
if (is_shop())
echo 'Custom text after every 5th product item only on the shop page';
elseif (is_product_category())
echo '' . do_shortcode('[block id="968"]') . '';
}
});
OR
add_action('etheme_product_grid_list_after_product_item', function() {
global $paged, $page;
global $woocommerce_loop;
$repeat_banner_each_x_product_3 = 3; // after ONLY 3rd product the banner be shown
if ( $paged <= 1 ) {
if ( ($woocommerce_loop['loop'] == $repeat_banner_each_x_product_3) ) {
if ( is_shop() ) { // only for shop page
echo '<div>'.do_shortcode('[block id="968"]').'</div>';
}
// or
// if ( is_shop() || is_product_category() ) { // shop or category archive
// echo '<div>'.do_shortcode('[block id="968"]').'</div>';
// }
}
}
});
Static block [block id=”968″] is copied in backend settings -> Static blocks ( https://prnt.sc/ezfe7EGG_UI8)
Frontend example: https://prnt.sc/xk7XtcjQWtqc (shop), https://prnt.sc/WgRfdPgT0sPR (category banner)
Best regards,
Jack Richardson
The 8Theme’s Team















