Last active
February 6, 2024 09:51
-
-
Save cdils/6489927 to your computer and use it in GitHub Desktop.
Add utility bar widget areas above header.
This file contains 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
<?php // Remove this line | |
/** 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' ), | |
) ); | |
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>'; | |
} |
This file contains 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
/* Utility Bar | |
--------------------------------------------- */ | |
.utility-bar { | |
background-color: #333; | |
border-bottom: 1px solid #ddd; | |
color: #ddd; | |
font-size: 12px; | |
font-size: 1.2rem; | |
padding: 10px 0; | |
padding: 1rem; | |
} | |
.utility-bar a { | |
color: #ccff33; | |
} | |
.utility-bar a:hover { | |
text-decoration: underline; | |
} | |
.utility-bar-left, | |
.utility-bar-right { | |
width: 50%; | |
} | |
.utility-bar-left p, | |
.utility-bar-right p { | |
margin-bottom: 0; | |
} | |
.utility-bar-left { | |
float: left; | |
} | |
.utility-bar-right { | |
float: right; | |
text-align: right; | |
} | |
.utility-bar input[type="search"] { | |
background: inherit; | |
padding: 10px 0 0; | |
padding: 1.0rem 0 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment