WordPress.org

Forums

Removing default sidebar widget areas in twentyeleven child theme (4 posts)

  1. mb studio services
    Member
    Posted 4 years ago #

    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

  2. mb studio services
    Member
    Posted 4 years ago #

    Please excuse my typos, I have a quick mouse finger.

  3. mb studio services
    Member
    Posted 4 years ago #

    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

  4. ddpweb
    Member
    Posted 4 years ago #

    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 ?>

Topic Closed

This topic has been closed to new replies.

About this Topic