Skip to content

Instantly share code, notes, and snippets.

@deeman
Created August 15, 2020 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deeman/82a244b97aa8d302a08fd6458ea40ed6 to your computer and use it in GitHub Desktop.
Save deeman/82a244b97aa8d302a08fd6458ea40ed6 to your computer and use it in GitHub Desktop.
Genesis Framework - Top Bar Utility Bar
/*Top Bar Utility Bar, left & right*/
/** Register Utility Bar Widget Areas. */
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' ),
) );
//Display Widgets
add_action( 'genesis_before_header', 'utility_bar' );
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>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment