Placing Sidebar on Blog

Hello all!

I need some help placing a sidebar on the right side of my blog. Or more realistically, it could just be a widget area if need be. Anyway, before I get the “Change your Layout” answer, I have made sure that my blog is set to “Global Layout” and that my Global layout is set to “Content Left, Sidebar Right”. Please help!

Thanks in advance!

Hi There,

The sidebar container is present when I check. There’s just no content. See this: https://screencast-o-matic.com/watch/cb6YflIM56
Go to Appearance > Widget: Check the content of Main Sidebar. If you don’t have any customization, the content on Main Sidebar should appear by default. If there is content, would you mind giving us credentials on a secure note so we can double check your setup?

This didn’t work for me. I will leave my credentials below

FYI, our site got migrated from DNN (FML) and a bunch of what they did is unorganized and I hate them for it. Anyway, here are my credentials.

Hi There,

Could you please also tell us what’s the login URL?

I tried with the http://www.asti.com/wp-admin URL but no luck.

Thanks.

Yep, it is below

Hi There,

Upon checking your blog page your sidebar is working fine.

If you cannot see it on your end, please clean your browser cache and check it again.

Let us know how it goes.

Thank you

Nope, this is because I converted one of my headers into a sidebar for my blog, which is fine for now, but I will run into 100 problems once I try to make this page mobile responsive.

Hi there,

Do you have existing customization with the sidebar? There is no assigned sidebar on your blog, I also assigned one, then added widgets on both main sidebar and assigned sidebar and nothing is working. Hence, there could be something altering how the sidebar is being displayed.

Would you mind providing your FTP login credentials as well? I can’t check your theme’s functions.php.

Thanks!

Yep, my credentials will be below. Thanks for all your help already!

Hi there,

Your layout is set to full-width in which inherited by the blog layout, so I went ahead and added this code to your child theme’s functions.php to override it.

 function x_get_content_layout() {

    $content_layout = x_get_option( 'x_layout_content' );

    if ( $content_layout != 'full-width' ) {
      if ( 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() ) {        
        $layout = 'content-sidebar';
      } 

    return $layout;

  }

Another thing is, you have this custom code

function custom_sidebar_widgets_init() {
	
	register_sidebar( array(
		'name'          => 'Blog Sidebar',
		'id'            => 'Blog_sidebar',
		'before_widget' => '<div>',
		'after_widget'  => '</div>',
		'before_title'  => '<h2 class="rounded">',
		'after_title'   => '</h2>',
	) );

register_sidebar( array(
		'name'          => 'BLOG SIDEBAR',
		'id'            => 'blog_sidebar_menu',
		'before_widget' => '<div>',
		'after_widget'  => '</div>',
		'before_title'  => '<h2>',
		'after_title'   => '</h2>',
	) );

	register_sidebar( array(
		'name'          => 'Top Footer 1',
		'id'            => 'top_footer_1_menu',
		'before_widget' => '<div>',
		'after_widget'  => '</div>',
		'before_title'  => '<h2>',
		'after_title'   => '</h2>',
	) );

	register_sidebar( array(
		'name'          => 'Top Footer 2',
		'id'            => 'top_footer_2_menu',
		'before_widget' => '<div>',
		'after_widget'  => '</div>',
		'before_title'  => '<h2>',
		'after_title'   => '</h2>',
	) );

	register_sidebar( array(
		'name'          => 'Top Footer 3',
		'id'            => 'top_footer_3_menu',
		'before_widget' => '<div>',
		'after_widget'  => '</div>',
		'before_title'  => '<h2>',
		'after_title'   => '</h2>',
	) );

	register_sidebar( array(
		'name'          => 'Footer 5',
		'id'            => 'footer_5_menu',
		'before_widget' => '<div>',
		'after_widget'  => '</div>',
		'before_title'  => '<h2>',
		'after_title'   => '</h2>',
	) );

	register_sidebar( array(
		'name'          => 'Footer 6',
		'id'            => 'footer_6_menu',
		'before_widget' => '<div>',
		'after_widget'  => '</div>',
		'before_title'  => '<h2>',
		'after_title'   => '</h2>',
	) );

}
add_action( 'widgets_init', 'custom_sidebar_widgets_init' );

And those sidebars are not or can’t be assigned to the Blog page. You should create sidebar through Admin > Appearance > Sidebars and assign it to your blog.

I did all of these and nothing’s change, example, the sidebars created by that custom code are still there. Perhaps your provided FTP is pointing to a staging site? What I’m checking is your live site.

Thanks!

ALL OF YOU ARE AMAZING! Rad, you were spot on. I accidentally sent you to our staging FTP by accident (my bad), however, I changed some things around on the staging site and pushed live and now the sidebar is up! Thank you guys so much for all of your help. It is heavily appreciated by me as well as I’m sure the entire WP community.

Thanks!

You’re most welcome.

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