WordPress twenty eleven sidebar on Pages

I am using 2011 theme, any how I managed to get sidebar on single.php pages by installing child theme,But now I want sid

I am using 2011 theme, any how I managed to get sidebar on single.php pages by installing child theme,

But now I want sidebar on pages,

How do I get it?

I am using 2011 theme, any how I managed to get sidebar on single.php pages by installing child theme,

But now I want sidebar on pages,

How do I get it?

Share Improve this question edited Apr 24, 2019 at 11:05 Teja Bhagavan Kollepara 1255 bronze badges asked Jul 15, 2011 at 5:09 Niraj ChauhanNiraj Chauhan 8503 gold badges19 silver badges43 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 4

Funny you should ask, I've just posted an How to tutorial on how to add a sidebar on posts and pages in Twenty Eleven

Bainternet's tutorial is very good.

Another tutorial, which worked for me (and is actually a little simpler) is here:

http://futurewebblog/add-sidebar-support-posts-twenty-eleven-theme/

And here's what I added to my functions.php file, after studying both tutorials:

    /*
     * Fix for no sidebar in single posts
     * From http://futurewebblog/add-sidebar-support-posts-twenty-eleven-theme/
     */

    /* In child themes the functions.php is applied before the parent
     * theme's functions.php. So we need to wait for the parent theme to add 
     * it's filter before we can remove it.
     */
    add_action( 'after_setup_theme', 'my_child_theme_setup' );

    /**
     * Removes the filter that adds the "singular" class to the body element
     * which centers the content and does not allow for a sidebar
     * By http://futurewebblog/add-sidebar-support-posts-twenty-eleven-theme/
     */
    function my_child_theme_setup() {
        remove_filter( 'body_class', 'twentyeleven_body_classes' );
    }

I didn't have to make any changes to CSS, and it worked!

HTH. Jeff

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745558690a4632974.html

相关推荐

  • WordPress twenty eleven sidebar on Pages

    I am using 2011 theme, any how I managed to get sidebar on single.php pages by installing child theme,But now I want sid

    21小时前
    50

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信