Sidebar issue on product category page

I’m currently trying to add a side bar to a specific product-category page ONLY, for some reason the side bars aren’t loading on the page. It creates a space for it on the site, but doesn’t show. I tried using the template left sidebar - content right, and the page doesn’t load any content. I deactivated all plugins to see if any were conflicting with the theme and nothing changed.

I just need to add a specific sidebar to one product category page.

Hi There,

Please add the following code under functions.php file locates in your child theme:

add_filter( 'ups_sidebar', 'x_woocommerce_sidebar' );
function x_woocommerce_sidebar($sidebar){
	if( is_product_category() ){
		return 'ups-sidebar-woocommerce';
	}
	return $sidebar;
}

After that replace the woocommerce with your sidebar id.

Hope it helps :slight_smile:

I put this code into my functions file, and it shows the side bar, but it doesn’t show the side bar when you use the filters, the sidebar disappears. Could it be an issue with the plugin?

Hi There,

Would you mind providing us with login credentials(by clicking on the Secure Note button at the bottom) so we can take a closer look? To do this, you can make a post with the following info:

  • Link to your site
  • WordPress Admin username / password
  • FTP credentials

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.