Last active
December 27, 2015 16:09
-
-
Save nutsandbolts/7352828 to your computer and use it in GitHub Desktop.
Add a homepage-only welcome widget area to Genesis themes (functions.php)
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
// Add welcome message before content on homepage | |
add_action( 'genesis_before_loop', 'nabm_welcome_message' ); | |
function nabm_welcome_message() { | |
if ( ! is_home() || get_query_var( 'paged' ) >= 2 ) | |
return; | |
genesis_widget_area( 'welcome-message', array( | |
'before' => '<div class="welcome-message" class="widget-area">', | |
'after' => '</div>', | |
) ); | |
} | |
genesis_register_sidebar( array( | |
'id' => 'welcome-message', | |
'name' => __( 'Welcome Message', 'nabm' ), | |
'description' => __( 'This is the welcome message widget area.', 'nabm' ), | |
) ); |
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
/* Welcome Widget on Blog Page | |
--------------------------------------------- */ | |
.welcome-message { | |
background-color: #ffffff; | |
border-bottom: 1px dotted #ddd; | |
margin-bottom: 30px; | |
margin-bottom: 2rem; | |
padding: 30px 40px 20px; | |
padding: 2rem 2.8rem 1.4rem; | |
} | |
.welcome-message .widget:last-child { | |
margin-bottom: 0; | |
} | |
.welcome-message .widget-title { | |
text-align: left; | |
text-transform: none; | |
} | |
.welcome-message .widget-title { | |
font-size: 30px; | |
font-size: 3rem; | |
font-weight: 700; | |
text-align: center; | |
} | |
.welcome-message p { | |
font-size: 14px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment