Web Hosting Geeks | Web Hosting Experts
Need help? Call us 1(866)TOP-HOST

14625 reviews 1734 hosting providers

Questions & Answers

No sidebar menu inside posts of WP twenty eleven theme

Feb 27, 2013 by SunFun
Hi..
I am using Twenty eleven theme, and I want to have the same sidebar I currently have in my Home page  inside my posts.  How can I add the sidebar to my posts? I already have a child theme that I added all my changes to.
Can anyone please help?
Thanks

2 Answers

0 votes
Feb 27, 2013 by WebProX
Remove all the CSS fixes and add the below line to the post template file
<?php get_sidebar(); ?>
0 votes
Feb 27, 2013 by expert
here's what you need to do in your child theme:

1. add the below code to the function.php file
add_action( 'after_setup_theme', 'my_child_theme_setup' );
 
    function my_child_theme_setup() {
    // Removes the filter adding the "singular" class to the body element
    // that does not allow for a sidebar
    remove_filter( 'body_class', 'twentyeleven_body_classes' );
    }
2.in the single.php file and right before the line <?php get_footer(); ?>
add this line <?php get_sidebar(); ?>