WP Smith

Creating WordPress & Genesis Websites Since 2010

  • Home
  • About
  • Services
  • Blog
  • Contact

Mar 29 2011

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]

Written by Travis Smith · Categorized: Genesis, Tutorials

StudioPress Premium WordPress Themes     WP Engine Managed WordPress Hosting

What can I do for you!?

Custom Development

We develop plugins by determining both business/functional and technical requirements, following WordPress development best practices, and using agile methodology to ensure you get the best solution.

Consulting

Have questions? Need a reliable developer to consult? Please contact us today!

Customized Theme

We can customize your theme or child theme, or create a child theme for you based on your needs while enhancing the performance of every individual attribute.

Customized Plugin

We can customize your plugins, extend plugins (e.g., Gravity Forms, Jetpack, Soliloquy) based on your needs ensuring security, performance, and positive business impact.

Contact Us

About Travis Smith

As a WordPress enthusiast, developer, and speaker, Travis writes about what he learns in WordPress trying to help other WordPress travelers, beginners and enthusiasts with tutorials, explanations, & demonstrations.

Comments

  1. Rian says

    May 25, 2012 at 7:41 am

    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

    Reply
    • Travis Smith says

      July 17, 2012 at 11:07 am

      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.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Twitter
  • Facebook
  • LinkedIn
  • Google+
  • RSS

Copyright © 2025 � WP Smith on Genesis on Genesis Framework � WordPress � Log in