Sidebar on Blog Posts Not Appearing

On this page: https://newlink-staging.com/topics/regulation/trader-controls-managing-risks-and-maintaining-reputations/

No sidebar appears.

I’ve configured it to appear here: http://prntscr.com/gv3i8d

And the sidebar appears on some of the blog posts but not all.

Puzzled.

Hi,

That settings will just assign a sidebar but will not change the layout.

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

function single_post_layout($layout) {  
   if(is_singular('post')) {
       $layout = 'content-sidebar';
   }
  return $layout;
}

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

Hope that helps.

Your answer makes no sense. Why does the sidebar appear on some Posts and not others?

This post has a sidebar: https://newlink-staging.com/markets/fx/the-fx-global-code/
And this one doesn’t: https://newlink-staging.com/markets/otc-derivatives/transforming-trade-in-the-eu-derivatives-market/

I don’t want to edit a PHP file to solve this - if the first post has a sidebar, why doesn’t the second one above?

Bill.

UPDATE: If I recreate a blog post the correct sidebar appears - the posts created in July are not being allocated the correct sidebar - why is that?

I just added a new blog post here: https://newlink-staging.com/markets/otc-derivatives/planning-for-the-implications-of-brexit/

Which picks up the ‘main’ default sidebar. In the sidebar settings, the Category ‘Thinking’ has a different sidebar attached - why doesn’t this post pick up that method of setting the sidebar?

Thanks, Bill.

Hello Bill,

Thanks for updating in! You are experiencing this issue because you created a custom Blog Index Sidebar sidebar in Appearance > Sidebars and assigned this sidebar to some of your posts, pages and categories. The problem is that in this sidebar, you haven’t assign any widgets yet.

Please go to Appearance > Widgets and insert some widgets in the Blog Index Sidebar so that the sidebar will have some contents.

If you need anything else we can help you with, please let us know.

Hello, I am having the same problem. My sidebar doesn’t show on any of my posts in desktop view but does in tablet and mobile view. Can you please assist?

Hi,

To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

Thank you.