Set up Global Layout for all blog posts in X Pro Theme

Hello, I’m trying to create blog posts in X Pro theme that will be accessible on global layout - meaning same layout will be applied on all posts. Problem is, I don’t know how to assign global layout that I created for them to all blogs at once. How can I do that? I searched everything but did not find any solution.

Thank you.

Hi,

Thanks for writing in!

You can set it under Theme Options > Layout and Design

and Theme Options > Blog

By selecting Use Global Content Layout it will get the settings you have set in Layout and Design

For more information kindly refer to the link below

Hope that helps

It did not helped me at all as I already know this… I want to set up blog to look like this link: https://www.cheadledatarecovery.co.uk/news/ but problem is that I don’t know how to set up this in Global Content Layout as it is a bit confusing to me what is connecting with what. How can I set it up to look like that (similar layout of blog)? Plus, I want to set up each post looks like e.g. https://www.cheadledatarecovery.co.uk/2018/06/advanced-memory-stick-recovery-failure-of-ecc/ but as I stated I don’t know how to connect global content layout with that and make that type of layout. I’ll really appreciate if you can help. Thanks

Hi @cheadledatarecovery

Could you please share some links showing this issue from your current website?

Something like, what layout you have built and on which pages you want to apply?

Thanks.

But I did explain this… I want blog page (where there are list of posts) to be same structure like this is: https://www.cheadledatarecovery.co.uk/news/

And for single post pages, I want them to look like https://www.cheadledatarecovery.co.uk/2018/06/advanced-memory-stick-recovery-failure-of-ecc/ in terms of structure of course. So there will be also sidebar on the right (where I can add items in sidebar? )? Can you help me with this?

Hi @cheadledatarecovery,

The layout and design option that is provided above is global. Or perhaps you mean Not Global? Example, let’s say your site uses full-width but you wish your blog to have a sidebar? Which means, it’s not global. If that’s correct then please add this code to your child theme’s functions.php and this will apply sidebar to your blog and post page regardless of the setting.

  function x_get_content_layout() {

    $content_layout = x_get_option( 'x_layout_content' );

    if ( $content_layout != 'full-width' ) {
      if ( is_home() ) {
        $opt    = x_get_option( 'x_blog_layout' );
        $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
      } elseif ( is_singular( 'post' ) ) {
        $meta   = get_post_meta( get_the_ID(), '_x_post_layout', true );
        $layout = ( $meta == 'on' ) ? 'full-width' : $content_layout;
      } elseif ( x_is_portfolio_item() ) {
        $layout = 'full-width';
      } elseif ( x_is_portfolio() ) {
        $meta   = get_post_meta( get_the_ID(), '_x_portfolio_layout', true );
        $layout = ( $meta == 'sidebar' ) ? $content_layout : $meta;
      } elseif ( is_page_template( 'template-layout-content-sidebar.php' ) ) {
        $layout = 'content-sidebar';
      } elseif ( is_page_template( 'template-layout-sidebar-content.php' ) ) {
        $layout = 'sidebar-content';
      } elseif ( is_page_template( 'template-layout-full-width.php' ) ) {
        $layout = 'full-width';
      } elseif ( is_archive() ) {
        if ( x_is_shop() || x_is_product_category() || x_is_product_tag() ) {
          $opt    = x_get_option( 'x_woocommerce_shop_layout_content' );
          $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
        } else {
          $opt    = x_get_option( 'x_archive_layout' );
          $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
        }
      } elseif ( x_is_product() ) {
        $layout = 'full-width';
      } elseif ( x_is_bbpress() ) {
        $opt    = x_get_option( 'x_bbpress_layout_content' );
        $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
      } elseif ( x_is_buddypress() ) {
        $opt    = x_get_option( 'x_buddypress_layout_content' );
        $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
      } elseif ( is_404() ) {
        $layout = 'full-width';
      } else {
        $layout = $content_layout;
      }
    } else {
      $layout = $content_layout;
    }
   

    if ( is_home() || is_singular( 'post' ) ) return 'content-sidebar';

    return $layout;

  }

Thanks!

Hmmm, I cannot see this sidebar now at all. And NO, I want sidebar on all pages including posts, page. Just homepage should not have sidebar.

Still, I’m looking for solution to turn all my posts to look nice on new layout on “new site” I provide. I’m trying to adjust it from “old site” design to new one but I see that this global layout might help me not to edit each and every post manually - one by one. That’s basically why I asked this. Beside that, sidebar is not working. Can you please login and help? Seems like I’m missing something here on this theme.

Hi @cheadledatarecovery,

I see, then it’s not specific to blog and post as you initially explained and requested. In that case, please change that code to this shorter code.

  function x_get_content_layout() {
    if ( is_front_page()  ) return 'full-width';
    return 'content-sidebar';
  }

This should only remove the sidebar in your home page, the rest should have a sidebar.

Thanks!

Thanks but tell me, I cannot use different sidebars for different pages? For example, I want one sidebar to be on the posts and another type of sidebar to be on the particular pages. On some of them, I’ll not have sidebar at all. How to achieve that?

I rate this global layout of yours very very confusing thing. Global should mean that it applied to all content but it is not. Other than that, every post that I had on previous theme looks different on your theme (featured image is at the top broken etc.), check the difference between link1 and link2 so you can see what I mean. There are more than 200 posts so I would like to resolve them easier than to edit every post manually and adjust it to your theme. That’s basically not an option. Can you suggest or help me to achieve that?

Thanks

Hi,

  1. Yes you can use different sidebars for different page. For your guide kindly refer to the link below
  1. The idea behind Global Blocks is to have the ability to design something once and then utilize it throughout multiple pages or areas of your website. Down the road if edits ever need to be made, users can go back to the “single source of truth” (i.e. the representative Global Block) and edit it once there, and then have those changes reflected throughout the entire website.
  1. With regards to featured image, please note that every theme was designed differently and by switching themes your site will have a completely different layout. The same goes to any other wordpress themes.

I can see you are using Ethos stack, In Ethos the featured image was intentionally designed to be on top.

http://demo.theme.co/ethos-1/the-new-status-symbol/

Thanks

Tell me, how it is possible to my /news/ page to looks like http://demo.theme.co/ethos-1/ ? Where is shortcode that I can copy paste inside my page just without that first 4 boxes and slider under it?

Hello @cheadledatarecovery,

Thanks for updating the thread.

I checked the page link you have shared and as you are looking to mimic the layout of Ethos 1, please consider following solutions.

  1. Under Pro > Theme Options > Ethos you can activate Post slider option. However, as your are using header builder and even though you activate post slider, it won’t show up as header’s created using header builder overrides all the default settings.

  2. You can activate filter from Pro > Theme Options > Ethos > Blog Options. I have recorded a screencast in which I have demonstrated above two options.

  3. If you want to showcase some posts similar to the demo page (These Shoes Were Made For Walking), you can do that by editing the post in WordPress editor and under Ethos Post Settings > Index Featured Post Size select the option as per your requirement. Here is a screencast that you can take a look.

Thanks.

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