Remove "Main Sidebar" from Portfolio "Tag Archives" pages

Hi, I’d like to remove the main sidebar from the tag archives pages and just give it the default fullwidth layout with no sidebar. See screenshot. I know on most pages you can set the layout within the theme, but for the tag archives page how can this be accomplished? Thank you!

Hi,

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

function tag_full_width($layout) {  
   if(is_tag()) {      
       $layout = "full-width";
   }
  return $layout;
}

add_filter('x_option_x_layout_content', 'tag_full_width',9999);

Hope that helps

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

Hello @abgregs,

Thanks for updating the thread.

I have tested the code shared by my colleague @paul.r and on my local setup it’ working absolutely fine to have a full width page in tag archive. Here is a screencast that I have recorded:

Please setup the code as shown in the screencast and make sure to clear all caches when updating so that the code from the latest release is always in use. This will help you to avoid any potential errors.

That being said, please note that and as you can see that having fullwidth layout for tag archive page require custom development. While it’s outside the scope of support but my colleague went above and beyond to help you get the desired layout. However, providing support for custom codes (like PHP changes) falls outside the scope of support we can offer. In case of any issues with the layout because of custom codes we won’t be able to provide support. Beyond this it will be difficult for us to help you on this customization request.

Thanks for understanding.