Single Post Page full width

Hi,

How to remove the sidebar from the single post page? http://demo.theme.co/integrity-1/5-reasons-you-need-the-x-theme/

Need to make the post as full width?

Thanks

Hi,

To make your single post page full width.

You can add this in your child theme’s functions.php file.

function make_post_fullwidth($layout) {  
   if(is_singular('post')) {
       $layout = "full-width";
   }
  return $layout;
}

add_filter('x_option_x_layout_content', 'make_post_fullwidth',999);

For mroe information kindly refer to the link below.

https://theme.co/apex/forum/t/customizations-actions-and-filters-in-x/208

Hope that helps.

Hi,

Thanks it worked. In the theme file where the single post file is?

Also, I would like to remove the sidebar from the search result page, post tag page, and category page. How to do that? Where are those files in parent theme?

Thank you in advance!

Regards
Aamir

Hi,

It depends which stack you are using.

It’s in wp-content/themes/x/framework/views/{STACK}/wp-single.php

The view files are in wp-content/themes/x/framework/views/{STACK}/ and wp-content/themes/x/framework/views/global

You can also add another conditional statement to the code I provided.

function make_post_fullwidth($layout) {  
   if(is_singular('post') || is_search() || is_category() || is_tag()) {
       $layout = "full-width";
   }
  return $layout;
}

add_filter('x_option_x_layout_content', 'make_post_fullwidth',999);

For more information kindly refer to the link below

https://codex.wordpress.org/Conditional_Tags

Hope that helps

Thank you, with this code posts are showing as fullwidth. Could you modify this to show them as Masonry?

Hi there,

Just kindly remove the is_category section. Then you can have the Masonry option at hand by going to X > Launch > Options > Blog and set it from there.

Thank you.

Thanks for this.

What if we want to remove the sidebar so that we have consistent layout but then we still want a bar with recent posts etc, we just want it to be within the middle section and not all the way to the top / bottom?

Thx so much.

Hi,

Regretfully, It could only be possible with custom development, but this would be outside the scope of support we can offer. You may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities.

Thanks for understanding. Take care!