Adding a side bar on blog page and all blog posts

I am trying to add a sidebar image to my main blog page (that shows all the posts) and each of the blog posts using the wordpress widget but this is not working.

Is there an easy way for me to do this in xtheme without manipulating any child theme code?

Hi @sanachoudary,

Thanks for writing in.

You can check the link below on how to add sidebars.

Hope it helps.

Let us know how it goes.

Thanks.

That is actually exactly what I have set up but I see nothing there.

Screenshots showing my setup:


How can I fix this?

Hi,

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

function cat_sidebar($layout) {  
    if( is_category()) {      
       $layout = "content-sidebar";
   }
  return $layout;
}
add_filter('x_option_x_layout_content', 'cat_sidebar',9999);

Hope that helps

I just did that and still no change as you can see here sanachoudary.com/blog

Hi,

Please replace code with this.

function cat_sidebar($layout) {  
    if( is_category() && is_home()) {      
       $layout = "content-sidebar";
   }
  return $layout;
}
add_filter('x_option_x_layout_content', 'cat_sidebar',9999);

Thanks

I did that and still nothing.

Have you actually diagnosed the issue properly? Do you need to look at my backend?

Hi there,

Yes, we should check your site first. Would you mind providing your site’s URL and login credentials in a secure note?

Thanks!

I just added a secure note with this information to my reply above.

Hi There,

Please navigate to Appearance > Customize > Layout and Design and set your Content Layout to Content Left, Sidebar Right, saved.

Navigate to Appearance > Widgets and use the Main Sidebar for adding widgets (e.g. your image code)

Navigate to Appearance > Sidebars and remove the BlueprintSideBar from the Blog index page, from now on use the Main Sidebar for adding widget.

Use a Blank - No Container, Header | Footer page template to your pages if you don’t want the pages to have a sidebar.

Hope it helps,
Cheers!

1 Like

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