You may want to add a new widget section on homepage of your Genesis powered WordPress website. New widget area can be used for any type of widget content like for showing featured posts, responsive slider, introduction tagline text and so on.

Create new widget area on homepage in Genesis

1. Add following code in functions.php file found at Appearance > Editor in WordPress dashboard. It adds new widget with name “homepage-feature” on the homepage.


/** Add new widget under header on homepage in Genesis theme | basicwp.com/add-new-widget-genesis-homepage/ */
genesis_register_sidebar( array(
'id' => 'homepage-feature',
'name' => __( 'Homepage Feature', 'custom' ),
'description' => __( 'This is Homepage feature section', 'custom' ),
) );

/** Top Homepage feature section */
add_action( 'genesis_after_header', 'news_homepage_feature', 9 );
function news_homepage_feature() {
if ( is_home() && is_active_sidebar( 'homepage-feature' ) ) {
echo '

';
dynamic_sidebar( 'homepage-feature' );
echo '

';
}
}

2. Once you add above code, goto Widgets area and you should see new “homepage-feature” section. You can drag any widget to display content in new the widget area on your Genesis website. You can also customize following in the above code:

CCS styling of content added to this widget area can done using “homepage-feature” class. To get started, you can add following code to style.css file and modify it further as per requirement.


.homepage-feature {
background:#ddd;
width:960px;
margin:0 auto;
}

The place where widget is displayed, above code adds new widget below the “header”. You can replace “genesis_after_header” in above code with appropriate position or location hook.

– If you want widget to appear on everypage, remove “is_home()” in the above code. By default, above code will show widget only on the homepage.

Davinder Singh Kainth

A digital creator with 15+ years of experience in Website Design, Development, SEO, and Content Creation to Podcasting at SmartWebCreators.com with the motto of "Be Smart, Keep Creating". A coach, consultant, and your dear geek friend ❖

4 Comments

  1. Anton on January 28, 2013 at 8:31 pm

    Thanks for posting this tutorial. I added the code but the featured area is actually showing up on my blog page instead of my homepage. I changed the settings in WordPress in the Reading section to use a static home page, so I would like to know how to add custom widget areas to the home page not blog.

    Thanks!

  2. gormley on February 22, 2013 at 8:04 pm

    when i insert this into my child theme function.php i get the dreaded blank page error. any advice?
    this is word press 3.5.1

  3. Bob Roman on July 29, 2013 at 2:51 pm

    This is why I love Genesis: everything is modular and with few lines of code you can add widgets and stuff.

  4. Janet on March 27, 2014 at 2:11 am

    This worked perfectly and easily! Thank you!

Leave a Comment