Post Page Template

Hi,

I’d like for my post single pages to be Blank, No Container, Header, Footer. I can’t find a way to do this however. Is there a way to change the global default page attributes?

I added a function to my child theme functions in order to add a sidebar to one of my pages. So when a page is set to Default, it adds extra space on the left side, which it is doing on my single post pages. I’d like for my single post to be full width (although I may decide to add the sidebar).

I see in the Theme Options I can can choose either Use Global Content Layout or Fullwidth for the Blog. But how do I change the Global Content Layout?

Thanks,
Jen

Hey Jen,

Regretfully, this is not yet a feature offered in X. The Layout Builder which will allow users to create custom templates and assign them to archives and single post is still under development.

If your Content Layout is Fullwidth and you want to a sidebar to some post or pages only, you will need to use override the option with this custom code.

/* Enable Sidebar for Specific Post */

add_filter('x_option_x_layout_content', 'override_layout_content_for_single');

function override_layout_content_for_single( $layout ) {  
    if ( is_single(3214) )  {      
       $layout = "content-sidebar";
   }
  return $layout;
}

The important bit to look at there is the WordPress Conditional is_single(3214). For more details about the usage of the conditional, please see https://developer.wordpress.org/reference/functions/is_single/

If you have not done so yet, I’d recommend that you see our latest status update to know our current plans. See https://theme.co/apex/forum/t/status-report-december-4-2018/48648

Thanks.

Thank you! That worked better than the other function I was using and I as able to use is_page to target the exact page I wanted the sidebar on. Now my post pages look correct.

Thanks!

Glad we were able to help :slight_smile:

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