• I created a child theme for Twenty Eleven and added a second sidebar using code I found in the WP forums, but the sidebar isn’t showing up on my site.

    First I added the following code to my sidebar.php file:

    [code moderated - please use the http://pastebin.com/ for any code longer than 10 lines - see http://codex.wordpress.org/Forum_Welcome#Posting_Code ]

    Then I registered the sidebar in my functions.php file:

    <?php
    if ( function_exists('register_sidebar') )
        	register_sidebar(array(
            	'name' => __( 'Right Sidebar', 'twentyeleven_child' ),
    		'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>',
    	) );
    ?>

    Lastly, I changed the layout in my stylesheet:

    [CSS code moderated - please just post a link to your site]

    I've tried making a new index.php file and I've played around with the #tertiary margins but the new sidebar is not showing up. It's definitely registered because I can see it in Appearance > Widgets on the admin page.

    If anyone has advice for how to fix this I'd be most grateful. I'm new to WP and I know basically nothing about CSS and theme development.

    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • I am having a similar issue.. but I am having issues having the additional sidebars created appear on the selected pages I want.. with that said, I was able to create the additional sidebars just by going into my functions.php and simply copying the default sidebar code and replace the sidebar name with your unique ID.

    [please read the forum guidelines for posting code]

    <?php
    if ( function_exists('register_sidebar') )
        	register_sidebar(array(
            	'name' => __( 'Right Sidebar', 'twentyeleven_child' ),
    		'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>',
    	) );
    ?>

    now you should be able to go to your widgets in dashboard and add additional widgets into each sidebar you’ll like…

    Now having the sidebars appear on the site on different page if that is your goal is where we’re both stuck at

    @rmfn8475
    please start your own topic;
    and post a link to your site to illustrate your problem.

    Thread Starter gumshoeg

    (@gumshoeg)

    @rmfn8475
    I can add widgets, but I can’t see them because the sidebar isn’t showing at all–anywhere. When I look at the site in Firebug, there is no section called “tertiary.”

    My site is: http://www.gumshoegastronomy.com

    I don’t know if this would help you, but I installed the Twenty Eleven Theme Extensions plugin to get my sidebar (and hopefully this new one if I can get it to work) to show on all pages. It works on the main sidebar.

    Good luck!

    i don’t know the inner workings of the Twenty Eleven Theme Extensions plugin; however, you coudl try to de-activate it for a test, to see if your second sidebar will then show on the front page.

    also, double check if the edited sidebar.php is in your child theme, and uploaded to the server, in your active theme.

    Thread Starter gumshoeg

    (@gumshoeg)

    Thanks for your suggestions. I deactivated the plugin but that didn’t solve the problem. And the edited sidebar.php file is in the active theme.

    Since the sidebar is showing up on my admin page but not my site could it have something to do with the layout in my stylesheet?

    the sidebar is showing up on my admin page

    this is ok and it caused by the additional code in functions.php.

    but not my site could it have something to do with the layout in my stylesheet?

    no – there is simply no sign of any html div with the tertiary css class in the html code in the browser – as if the new part had not been added to sidebar.php of your child theme.

    can you paste the full code of sidebar.php into http://pastebin.com/ and post the link to it here for someone to have a look?

    Thread Starter gumshoeg

    (@gumshoeg)

    i added the sidebar to a naked child theme of twenty eleven, and the code shows without problem on the site.

    triple check that the sidebar.php is in your active theme folder location on the server.

    what do you get, if you go to
    dashboard – apperance – editor: sidebar.php of the Gumshoe theme?

    is the ‘tertiary’ part in that file?

    Thread Starter gumshoeg

    (@gumshoeg)

    Okay, I figured out what was wrong. I had named the sidebar.php file “sidebars.php” so I didn’t confuse it with the Twenty Eleven sidebar file. I didn’t realize the name made a difference. Sorry to have wasted your time with that.

    Now the problem is that my admin screen is blank. This happened right after I got the sidebar to show up. Do you know what might have caused this?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Twenty Eleven second sidebar not showing’ is closed to new replies.