Hello @Martin,
You may consider implementing the following code snippet in your child theme/functions.php file to display the Static block (https://www.8theme.com/documentation/xstore/support/static-blocks/) in specific position on Product category page (as you main Shop page displays the product categories items):
add_action('woocommerce_shop_loop', function() {
global $paged, $page;
global $woocommerce_loop;
$banner_shortcode = false;
$position_banner = 6;
if ( $paged <= 1 && is_product_category() ) {
if ( is_product_category('computer-pc') ) { // to display specific banner on specific category by slug
$position_banner = 3;
$banner_shortcode = '[block id="298"]';
}
if ( is_product_category('smart-gadgets') ) { // to display specific banner on specific category by slug
$position_banner = 2;
$banner_shortcode = '[block id="809"]';
}
if ( $banner_shortcode && (($woocommerce_loop['loop'] / 2) == $position_banner) ) {
$classes = array('shop-loop-banner product'); // product class for grid layout
if ( !wc_get_loop_prop( 'etheme_default_elementor_products_widget', false ) && function_exists('etheme_get_product_class') )
$classes[] = etheme_get_product_class( $woocommerce_loop['columns'] );
echo '<div class="'.implode(' ', $classes).'">';
echo do_shortcode($banner_shortcode);
echo '<span class="screen-reader-text">Shop banner</span>';
echo '</div>';
}
}
}, 9999);
Please, make any imlementations only via FTP as some errors may occur, so your wp-admin may be blocked if you make changes from Dashboard -> Appearance -> Edit Theme.
Best Regards,
Jack Richardson
The 8Theme’s Team















