You can display WCPS on shop an archive page,
on shop page: you can use the following code under theme functions.php file to display slider on shop page before loop.
add_action( 'woocommerce_before_shop_loop', 'wcps_on_shop_page_top', 20 ); function wcps_on_shop_page_top($content) { $active_plugins = get_option('active_plugins'); $shop_page_id = wc_get_page_id('shop'); if(in_array( 'woocommerce/woocommerce.php', (array) $active_plugins ) && is_woocommerce() && is_shop()){ ?> <?php echo do_shortcode("[wcps id='1840']"); ?> <?php } }
See the screenshot
on all archive page including shop page
add_action( 'woocommerce_before_shop_loop', 'wcps_on_shop_page_top', 20 ); function wcps_on_shop_page_top($content) { $active_plugins = get_option('active_plugins'); $shop_page_id = wc_get_page_id('shop'); if(in_array( 'woocommerce/woocommerce.php', (array) $active_plugins ) && is_woocommerce()){ ?> <?php echo do_shortcode("[wcps id='1840']"); ?> <?php } }
Exclude shop page
add_action( 'woocommerce_before_shop_loop', 'wcps_on_shop_page_top', 20 ); function wcps_on_shop_page_top($content) { $active_plugins = get_option('active_plugins'); $shop_page_id = wc_get_page_id('shop'); if(in_array( 'woocommerce/woocommerce.php', (array) $active_plugins ) && is_woocommerce() && !is_shop()){ ?> <?php echo do_shortcode("[wcps id='1840']"); ?> <?php } }