WordPress.org

Support

Support » How-To and Troubleshooting » Removing default sidebar widget areas in twentyeleven child theme

Removing default sidebar widget areas in twentyeleven child theme

  • I am beginner and I spent almost three days through trial learning how to create page templates and new widget areas for my twenty eleven child theme. How do you properly unregister the default sidebars so that I can see my new widget areas that I have created ?

    I am currently using WordPress 3.3.2 with Twentyeleven theme 1.3

    Anyone with knowledge or nows where I can get help would be greatly appreciated.

    Mike

Viewing 3 replies - 1 through 3 (of 3 total)
  • Please excuse my typos, I have a quick mouse finger.

    So far the only way I am able to see the new widget areas is to number the sidebar id’s 6 and above IE: sidebar id-6

    I’m still looking for the code on that Default sidebar…

    but you can register as many of these as you need, simply by using code like this in that function.

    You don’t have to use the sidebar id number. These are primarily for the footer block.

    So you can just use something like this:

    register_sidebar( array(
    		'name' => __( 'Category Sidebar', 'twentyeleven' ),
    		'id' => 'sidebar-cat',
    		'description' => __( 'The sidebar is for category pages', 'twentyeleven' ),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h3 class="widgettitle">',
    		'after_title' => '</h3>',
    	) );

    and then call the Category Sidebar in your template, like this

    <?php if ( ! dynamic_sidebar( 'sidebar-cat' ) ) : ?>
    <?php endif; // end sidebar widget area ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Removing default sidebar widget areas in twentyeleven child theme’ is closed to new replies.
Skip to toolbar