Sidebar on product listing pages only
-
Hi,
I am trying to show the sidebar on product list page only. At the moment I have been using the following code which removes the sidebar from every page after the product category page which works great but not what I need.
/** * Hide Sidebar */ add_action( 'wp', 'woa_remove_sidebar_shop_page' ); function woa_remove_sidebar_shop_page() { if ( is_product_category()) { remove_action( 'storefront_sidebar', 'storefront_get_sidebar', 10 ); add_filter( 'body_class', 'woa_remove_sidebar_class_body', 10 ); } }
I want to be able to show the sidebar on the page which lists all the products in a specific category so I can add a product filter on the left column. I dont need a sidebar for the actual single product itself or for the category page the product list belongs to. I tried to add code to disable by tag_ID but this breaks my site.
Hopefully this makes sense. Thanks for any help.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Sidebar on product listing pages only’ is closed to new replies.