Skip to content

Instantly share code, notes, and snippets.

@nutsandbolts
Last active December 27, 2015 16:09
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 nutsandbolts/7352828 to your computer and use it in GitHub Desktop.
Save nutsandbolts/7352828 to your computer and use it in GitHub Desktop.
Add a homepage-only welcome widget area to Genesis themes (functions.php)
// 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' ),
) );
/* 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