• Hi there,

    i′m working on a new child theme for twenty twelve and wanted to add a new sidebar to it, but i haven′t been successful yet. I tried following instructions and using code of these articles:

    (Support | Codex)

    but all results i get are either:

    #pags stops working”

    or

    #part of the code is displayed on top instead of doing something.

    I already created a “sidebar-custom.php” in my child folder as well as an empty “functions.php” to add the registration, but nothing worked. Would be very nice to get some help with this.

    P.S.: I′d like to add the new sidebar to the top wrapping it into the header instead of moving it outside of the primary area. Would that work?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator t-p

    (@t-p)

    Thread Starter pb_advancis

    (@pb_advancis)

    Thanks so far ! I managed to register the sidebars and place them inside the theme. Everything works as expected now. But since i did this i got the following problem:

    Submitting a page edit or (de-)activating a plugin leads me to a white screen, as well as previewing a page. Changes are saved, but once on the white screen refreshing doesnt help. Removing the
    functions.php
    fixes the problem so the failure should be in this code:

    <?php register_sidebar( array(
    	'name'          => __( 'Sidebar Header', 'twentytwelve' ),
    	'id'            => 'sidebar-4',
    	'description'   => 'This Sidebar is located in the header area',
        'class'         => '',
    	'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    	'after_widget'  => '</aside>',
    	'before_title'  => '<h3 class="widgettitle">',
    	'after_title'   => '</h3>'
    	) );
    
    	register_sidebar( array(
    	'name'          => __( 'Sidebar Submenu', 'twentytwelve' ),
    	'id'            => 'sidebar-5',
    	'description'   => 'This Sidebar is located on the bottom of the header area',
        'class'         => '',
    	'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    	'after_widget'  => '</aside>',
    	'before_title'  => '<h3 class="widgettitle">',
    	'after_title'   => '</h3>'
    	) ); ?>

    [No bumping, thank you.]

    I know this post is old so you’ve probably moved on by now , but I wanted to make a suggestion in case anyone else visits this page –

    It might be as simple as removing the closing php tag at the end of the child theme’s functions.php. A lot of people recommend not including the closing tag.

    (p.s. I haven’t tested the code above)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Registering an additional sidebar in child theme’ is closed to new replies.