WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Adding a seccond sidebar in Twenty Eleven theme (8 posts)

  1. YunShui
    Member
    Posted 2 years ago #

    Hi,

    Im trying to add a seccond sidebar in Twenty eleven theme, so I went to functions.php and added this

    register_sidebar( array(
    		'name' => __( 'rightsidebar', 'twentyeleven' ),
    		'id' => 'sidebar-6',
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3>',
    	) );

    in this section
    function twentyeleven_widgets_init() {

    Now I can see the new sidebar in the widgets area, but I can't figure how to add it in the index template.

    I've tryied to add this
    <?php get_sidebar(sidebar-6); ?>
    but it doesn't display anything.

    Any idea?

    Thank you!

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    Do not edit the Twenty Eleven theme. It is the default WordPress 3.2 theme and having access to an unedited version of the theme is vital when dealing with a range of site issues.

    Create a child theme for your customisations. Once your child theme is active, we should be able to help with the customisation.

  3. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    And once you have the child theme set up, peep this http://vudu.me/qq

    It's how I added 2 sidebars to twentyeleven

  4. YunShui
    Member
    Posted 2 years ago #

    Thank you both!
    Rev. I've created the child theme, so now I will read your link.
    Thank you!

  5. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    Sure thing... key in on the part about making a new php file for your sidebar. That is what you are missing in your above sequence

  6. YunShui
    Member
    Posted 2 years ago #

    Worked!
    Thank you again!

  7. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    Glad that worked for you@!

  8. saint-jerry
    Member
    Posted 2 years ago #

    Hi there, I was following the guide, but stuck at the point of adding the side bar, can you plz kindly send the code thank you. YunShui

Topic Closed

This topic has been closed to new replies.

About this Topic