Site icon WP Smith

How to Make My Own Genesis Child Theme Sidebar Available and Not the Default Primary and Secondary Sidebars

So if you want to make the two original sidebars unavailable, you first need to unregister those sidebars. To do this, add the following to your functions.php file.
[php]//Unregister Sidebars
unregister_sidebar('sidebar');
unregister_sidebar('sidebar-alt');

// Remove Default Genesis Sidebar
remove_action('genesis_sidebar', 'genesis_do_sidebar'); [/php]

Then you need to register your new widget area:
[php]add_action('genesis_sidebar', 'child_do_sidebar');
function child_do_sidebar() { ?>
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Child Sidebar') ){ ?><?php } ?>
<?php }
[/php]

Then add your Child Sidebar:
[php]// Add Child Sidebar
genesis_register_sidebar(array(
'name'=>'Child Sidebar',
'id' => 'sidebar-primary',
'description' => 'This is the primary Child sidebar',
'before_widget' => '<div id="%1$s"><div>',
'after_widget' => "</div></div>n",
'before_title' => '<h4><span>',
'after_title' => "</span></h4>n"
));[/php]