Created
October 9, 2013 05:42
-
-
Save srikat/6896727 to your computer and use it in GitHub Desktop.
To make home featured widgets in Minimum Pro appear site-wide, delete the code provided in first box from front-page.php and add the code provided in the second box in 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
if ( is_active_sidebar( 'home-featured-1' ) || is_active_sidebar( 'home-featured-2' ) || is_active_sidebar( 'home-featured-3' ) || is_active_sidebar( 'home-featured-4' ) ) { | |
//* Add Home featured Widget areas | |
add_action( 'genesis_before_content_sidebar_wrap', 'minimum_home_featured', 15 ); | |
} | |
//* Add markup for homepage widgets | |
function minimum_home_featured() { | |
printf( '<div %s>', genesis_attr( 'home-featured' ) ); | |
genesis_structural_wrap( 'home-featured' ); | |
genesis_widget_area( 'home-featured-1', array( | |
'before'=> '<div class="home-featured-1 widget-area">', | |
'after' => '</div>', | |
) ); | |
genesis_widget_area( 'home-featured-2', array( | |
'before'=> '<div class="home-featured-2 widget-area">', | |
'after' => '</div>', | |
) ); | |
genesis_widget_area( 'home-featured-3', array( | |
'before'=> '<div class="home-featured-3 widget-area">', | |
'after' => '</div>', | |
) ); | |
genesis_widget_area( 'home-featured-4', array( | |
'before'=> '<div class="home-featured-4 widget-area">', | |
'after' => '</div>', | |
) ); | |
genesis_structural_wrap( 'home-featured', 'close' ); | |
echo '</div>'; //* end .home-featured | |
} |
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 widget support for homepage if widgets are being used | |
add_action( 'genesis_meta', 'minimum_add_featured_widget_areas' ); | |
function minimum_add_featured_widget_areas() { | |
if ( is_active_sidebar( 'home-featured-1' ) || is_active_sidebar( 'home-featured-2' ) || is_active_sidebar( 'home-featured-3' ) || is_active_sidebar( 'home-featured-4' ) ) { | |
//* Add Home featured Widget areas | |
add_action( 'genesis_before_content_sidebar_wrap', 'minimum_home_featured', 15 ); | |
} | |
} | |
//* Add markup for homepage widgets | |
function minimum_home_featured() { | |
printf( '<div %s>', genesis_attr( 'home-featured' ) ); | |
genesis_structural_wrap( 'home-featured' ); | |
genesis_widget_area( 'home-featured-1', array( | |
'before'=> '<div class="home-featured-1 widget-area">', | |
'after' => '</div>', | |
) ); | |
genesis_widget_area( 'home-featured-2', array( | |
'before'=> '<div class="home-featured-2 widget-area">', | |
'after' => '</div>', | |
) ); | |
genesis_widget_area( 'home-featured-3', array( | |
'before'=> '<div class="home-featured-3 widget-area">', | |
'after' => '</div>', | |
) ); | |
genesis_widget_area( 'home-featured-4', array( | |
'before'=> '<div class="home-featured-4 widget-area">', | |
'after' => '</div>', | |
) ); | |
genesis_structural_wrap( 'home-featured', 'close' ); | |
echo '</div>'; //* end .home-featured | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment