WordPress Twenty Eleven Sidebar Missing on Single Posts

Hey Folks!

2011 missing sidebarJust a real quick one today, but still pretty useful. I’ve had a few people ask me about this problem so I thought i’d pop a super-fast tutorial together and then people can access it whenever they need it.

On WordPress 2011 theme when you create a single post, you’ll notice that by default it comes up with just one column and without a sidebar. Now, this is fine if you haven’t got useful stuff (or ads, affiliate deals etc) to show people on the sidebar. However, if you’re getting a lot of traffic to some specific single posts, it would be a great idea to let those visitors know about the rest of your content.

Here’s how to add a sidebar to the 2011 WordPress Theme

1. In the Theme Editor (Dashboard > Appearence > Editor), go to single.php and add the following:

<?php get_sidebar(); ?>

In a new line just above the footer code at the bottom of the file:

<?php get_footer(); ?>

Next, go to functions.php (Theme Functions) and find the following at the bottom of the file:

add_filter( 'body_class', 'twentyeleven_body_classes' );

Comment it out (by adding 2 forward slashes // at the beginning of the line) and it will force WordPress to stop differentiating between normal and single post pages.

Simple stuff, but useful nonetheless… Have a great day all! :)