admin管理员组

文章数量:1201992

I've recently added a plugin to have product filters (BeRocket) on my wordpress/woocommerce website. To display those filters on the page I made a widget and added it in my woocommerce.php page.

It's pretty much working as intended so far but it also displays the filters on the product pages since they're also generated from woocommerce.php..

Is there a way around that ? I just want those filters on the shop/category/tag pages, can I affect them directly without affecting the product pages ?

Any help appreciated. Best regards.

I've recently added a plugin to have product filters (BeRocket) on my wordpress/woocommerce website. To display those filters on the page I made a widget and added it in my woocommerce.php page.

It's pretty much working as intended so far but it also displays the filters on the product pages since they're also generated from woocommerce.php..

Is there a way around that ? I just want those filters on the shop/category/tag pages, can I affect them directly without affecting the product pages ?

Any help appreciated. Best regards.

Share Improve this question asked Mar 28, 2022 at 8:02 FLOFLO 1
Add a comment  | 

2 Answers 2

Reset to default 0

You need to use conditional tags of WooCommerce. Please have a look. In your case you can use this

if(!is_product()){
    //BeRocket Code
}

they have shortcodes that you place in the relevant archive templates that you want them to appear in.

this would need to be done in your child theme

get_shortcode('[ berocket_shortcode ]');

本文标签: pluginsHow to makes changes on the shopcategorytag pages but not on the product pages in woocommerce