How to Remove and Customize Sidebars in Genesis Theme

      

Genesis provide you default and secondary sidebar for you widgets but if you want remove, edit or customize wordpress genesis theme also you can add new custom sidebar and widget place some of code provide below use them.

First backup your complete website bcoz may be any accident happens now edit you function.php from theme editor.

 

Remove Default Sidebar

/** Remove default sidebar */
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );

Remove Secondary Sidebars

/** Remove secondary sidebar */
unregister_sidebar( 'header-right' );
unregister_sidebar( 'sidebar' );
unregister_sidebar( 'sidebar-alt' );

Add Custom Sidebar

/** Add custom sidebar */
genesis_register_sidebar(array(
	'name'=>'Alternative Sidebar',
	'id' => 'sidebar-alternative',
	'description' => 'This is an alternative sidebar',
	'before_widget' => '<div id="%1$s"><div>',
	'after_widget'  => "</div></div>\n",
	'before_title'  => '<h4><span>',
	'after_title'   => "</span></h4>\n"
));

Add Widgets

add_action( 'genesis_sidebar', 'child_do_sidebar' );
/**
 * Add a widget/sidebar area.
 *
 * @author Greg Rickaby
 * @since 1.0.0
 */
function child_do_sidebar() {
	if ( !function_exists( 'dynamic_sidebar' ) || !dynamic_sidebar( 'Sidebar Name' ) ) {
}}

Also if you don't want to edit any code try Genesis Simple Sidebars plugin for this.

About

Sandeep who always wants to explore and share interesting Tips, Tricks, Tutorials, Guides and More. Catch him on Twitter, Join Facebook Fan Page. Subscribe to wRock feed via RSS or EMAIL to receive instant updates.

comments

  1. Juan says:

    Hi,
    Nice tut! I discovered the plugin Custom Sidebars http://wordpress.org/support/plugin/custom-sidebars that allows to cofigure almost every sidebar in wordpress. Really recommended.
    Cheers and keep on giving these useful tips!

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Human Verification: In order to verify that you are a human and not a spam bot.