Last active
August 29, 2015 13:56
-
-
Save srikat/9045925 to your computer and use it in GitHub Desktop.
Replace Tagline section with a Widget Area only on homepage in Minimum Pro. http://sridharkatakam.com/replace-tagline-section-widget-area-homepage-minimum-pro/
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
if ( is_home() || is_front_page() ) | |
return; |
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
printf( '<div %s>', genesis_attr( 'site-tagline' ) ); |
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
//* Register Home Featured Tagline widget area | |
genesis_register_sidebar( array( | |
'id' => 'home-featured-tagline', | |
'name' => __( 'Home Featured Tagline', 'minimum' ), | |
'description' => __( 'This is the home featured tagline section.', 'minimum' ), | |
) ); | |
//* Add the custom featured section only on homepage | |
add_action( 'genesis_after_header', 'sk_home_featured_tagline' ); | |
function sk_home_featured_tagline() { | |
if ( ! ( is_home() || is_front_page() ) ) | |
return; | |
genesis_widget_area( 'home-featured-tagline', array( | |
'before' => '<div class="home-featured-tagline widget-area"><div class="wrap">', | |
'after' => '</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
/* Featured widget area in place of tagline on homepage | |
------------------------------------------------------------ */ | |
.home-featured-tagline { | |
margin-top: 600px; | |
background-color: #f5f5f5; | |
border-bottom: 1px solid #eee; | |
padding: 40px 0; | |
} | |
.home-featured-tagline .widget { | |
margin-bottom: 40px; | |
} | |
.home-featured-tagline .widget:last-child { | |
margin-bottom: 0; | |
} | |
@media only screen and (max-width: 1023px) { | |
.home-featured-tagline { | |
padding-left: 5%; | |
padding-right: 5%; | |
} | |
} | |
@media only screen and (max-width: 480px) { | |
.home-featured-tagline { | |
padding-left: 8%; | |
padding-right: 8%; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment