When I gave my first impressions of the new default WordPress theme Twenty Eleven back in May, I noted that the sidebar was removed from posts and pages. At the time I assumed that this would be addressed in the final stable version however it wasn’t, and as you would expect, a lot of people are annoyed about this.
Richard Gregory left a comment today asking how this could be amended so I thought I would look into the issue for everyone.
I quickly found a great article by Bart Surminski. I followed the steps in his article ‘Add sidebar to single post in the WordPress 3.2 Twenty Eleven theme‘ and applied the changes to one of my sites that is using Twenty Eleven.
The procedure is very straight forward. First of all you need to open up your single.php template and find the call for the footer:
<?php get_footer(); ?>
You simply need to add a call to the sidebar above this function like this:
<?php get_sidebar(); ?> <?php get_footer(); ?>
You should repeat the above step in your page.php template if you want to add a sidebar to your pages too.
The last thing you need to do is open your functions.php template then go to the bottom of the template and remove the function twentyeleven_body_classes. Bart advises that you simply comment the code out so it can be added later however I don’t think there’s any need as long as you have a back up of Twenty Eleven on your computer.
function twentyeleven_body_classes( $classes ) { if ( ! is_multi_author() ) { $classes[] = 'single-author'; } if ( is_singular() && ! is_home() && ! is_page_template( 'showcase.php' ) && ! is_page_template( 'sidebar-page.php' ) ) $classes[] = 'singular'; return $classes; } add_filter( 'body_class', 'twentyeleven_body_classes' );
An alternative method of adding the sidebar was initially suggested by Chris Aprea. He has since stated that modifying the functions.php template is more efficient.
Please read ‘Add sidebar to single post in the WordPress 3.2 Twenty Eleven theme‘ for a more complete guide in removing the sidebar from Twenty Eleven. If you are unsure about any stage of adding the sidebar, please let me know and I’ll do my best to help
Thanks,
Kevin






Hi - Thanks for the tip. I had another suggestion from a developer I work with to just change the last line from add_filter to remove_filter. This seemed to work just as well.
- spam
- offensive
- disagree
- off topic
Like