Skip to content

Instantly share code, notes, and snippets.

@captprice26
Created October 26, 2016 06:06
Show Gist options
  • Select an option

  • Save captprice26/f476f418d29970b75d29fad39177602d to your computer and use it in GitHub Desktop.

Select an option

Save captprice26/f476f418d29970b75d29fad39177602d to your computer and use it in GitHub Desktop.
For Wordpress - Genesis Theme secondary header (functions.php) *Note: DO NOT INCLUDE THE "<?php" tag
<?php
//* Secondary Top Header
genesis_register_sidebar( array(
'id' => 'utility-bar-left',
'name' => __( 'Utility Bar Left', 'theme-prefix' ),
'description' => __( 'This is the left utility bar above the header.', 'theme-prefix' ),
) );
genesis_register_sidebar( array(
'id' => 'utility-bar-right',
'name' => __( 'Utility Bar Right', 'theme-prefix' ),
'description' => __( 'This is the right utility bar above the header.', 'theme-prefix' ),
) );
function utility_bar() {
echo '<div class="utility-bar"><div class="wrap">';
genesis_widget_area( 'utility-bar-left', array(
'before' => '<div class="utility-bar-left">',
'after' => '</div>',
) );
genesis_widget_area( 'utility-bar-right', array(
'before' => '<div class="utility-bar-right">',
'after' => '</div>',
) );
echo '</div></div>';
}
add_action( 'genesis_before_header', 'utility_bar' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment