Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/** Register sub widget areas */
genesis_register_sidebar( array(
'id' => 'sub-widget-left',
'name' => __( 'Sub Widget Left', 'child' ),
'description' => __( 'This is the sub widget left section.', 'child' )
) );
genesis_register_sidebar( array(
'id' => 'sub-widget-right',
'name' => __( 'Sub Widget Right', 'child' ),
'description' => __( 'This is the sub widget right section.', 'child' )
) );
/** Add the sub widget section */
add_action( 'genesis_before_footer', 'wpsites_sub_widget', 5 );
function wpsites_sub_widget() {
if ( is_active_sidebar( 'sub-widget-left' ) || is_active_sidebar( 'sub-widget-right' ) ) {
echo '<div id="sub-widget"><div class="wrap">';
genesis_widget_area( 'sub-widget-left', array(
'before' => '<div class="sub-widget-left">'
) );
genesis_widget_area( 'sub-widget-right', array(
'before' => '<div class="sub-widget-right">'
) );
echo '</div><!-- end .wrap --></div><!-- end #sub-widget -->';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment