Enter your keyword


Registering the Widget Area in Genesis

The first step is to register the before header widget area through your functions file. Use the code below to do accomplish that:

//* Register before header widget area
genesis_register_sidebar( array(
'id' => 'before-header',
'name' => __( 'Before Header', 'theme-name' ),
'description' => __( 'This is the before header widget area.', 'theme-name' ),
) ); 

Hooking the Widget Area

Now that you have registered the before header widget area, you need to place that onto a hook that resides before the site header markup.

The code below will do that for you:

//* Hook before header widget area before site header
add_action( 'genesis_before_header', 'bg_before_header_widget_area' );
function bg_before_header_widget_area() {
genesis_widget_area( 'before-header', array(
'before' => '<div class="before-header widget-area"><div class="wrap">',
'after' => '</div></div>',
) );
} ?>

No Comments

Add your review

Your email address will not be published.

* Feilds are Required.