Full Screen on some post category types

Hi there, I’m not sure how to go about this. I had set my woocommerce shop page to full screen. Everything looked perfect. However, when I wanted to implement a right hand filter for ONE of my product categories, it forced me to set the view to a right side bar view.

This caused my filter / widget to appear for my one product category (yay!). But now everything else, including my main shop page is no longer in full screen mode (boo :frowning: ) .

Is there a way to set some post category and shop pages in full screen? Or, set one product category page with a side bar and leave the rest full screen?

Hi,

To achieve that, you can add the code below in your child theme’s functions.php file

add_filter('x_option_x_layout_content', 'make_full_width',999);
function make_full_width($layout) {  
   if(is_product_category('18')) {
       return "content-sidebar";
   }
   elseif ((is_shop() || is_product_category()))  {      
       return "full-width";
   } else {
        return $layout;
   }
}

Change 18 with the category id of the category page where you want your sidebar to appear.

Hope this helps

This worked beautifully! Thank you!!

You’re welcome!
Thanks for letting us know that it has worked for you.

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