Last active
June 16, 2016 03:44
-
-
Save cdils/6489328 to your computer and use it in GitHub Desktop.
Add two widgetized areas above the header in Genesis.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Register Utility Bar Widget Areas. | |
* | |
* @author Carrie Dils | |
* @copyright Copyright (c) 2013, Carrie Dils | |
* @license GPL-2.0+ | |
*/ | |
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' ), | |
) ); | |
add_action( 'genesis_before_header', 'utility_bar' ); | |
/** | |
* Add utility bar above header. | |
* | |
* @author Carrie Dils | |
* @copyright Copyright (c) 2013, Carrie Dils | |
* @license GPL-2.0+ | |
*/ | |
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