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]
Rian says
Hi,
Is it possible to change only the output in genesis_register_didebar?
I only want to change the H4 into an H2.
Can i use e.g. a filter for that?
Kind regards,
Rian
Travis Smith says
Hello Rian,
Yes you would need to use the genesis_register_sidebar_defaults filter. However, it is tricky to use. I’ll write up a tutorial about it.