Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Genesis - adding slideshow widget area and 4 smaller widget areas
/* Display Slideshow */
add_action( 'genesis_before_content', 'fiveBox_homepage_slideshow' );
/* Display Feature Boxes */
add_action( 'genesis_before_content', 'fiveBox_do_features' );
/* Function Slideshow */
function fiveBox_homepage_slideshow() {
echo '<div class="slideshow widget">';
dynamic_sidebar( 'homepage-slideshow' );
echo '</div>';
}
/* Function Feature Boxes */
function fiveBox_do_features() {
echo '<div class="feature-wrap">';
genesis_widget_area( 'homepage-box-1', array(
'before' => '<div id="homepage-1" class="widget one-fourth first">',
) );
genesis_widget_area( 'homepage-box-2', array(
'before' => '<div id="homepage-2" class="widget one-fourth">',
) );
genesis_widget_area( 'homepage-box-3', array(
'before' => '<div id="homepage-3" class="widget one-fourth">',
) );
genesis_widget_area( 'homepage-box-4', array(
'before' => '<div id="homepage-4" class="widget one-fourth">',
) );
echo '</div>';
}
/* Register Sidebars */
/* Homepage slideshow */
register_sidebar( array (
'name'=>'Homepage Slideshow',
'id' => 'homepage-slideshow',
'description' => 'This is the large slideshow on the homepage.',
));
/* box #1 of 4 */
register_sidebar( array (
'name'=>'Homepage Featured Left',
'id' => 'homepage-box-1',
'description' => 'This is the left-most box on the homepage.',
'before_widget' => '<div class="homepage widget">',
'after_widget' => "</div>\n",
'before_title' => '<h2><span>',
'after_title' => "</span></h2>\n"
));
/* box #2 of 4 */
register_sidebar( array (
'name'=>'Homepage Featured Middle Left',
'id' => 'homepage-box-2',
'description' => 'This is the second box on the homepage.',
'before_widget' => '<div class="homepage widget">',
'after_widget' => "</div>\n",
'before_title' => '<h2><span>',
'after_title' => "</span></h2>\n"
));
/* box #3 of 4 */
register_sidebar( array (
'name'=>'Homepage Featured Middle Right',
'id' => 'homepage-box-3',
'description' => 'This is the third box on the homepage.',
'before_widget' => '<div class="homepage widget">',
'after_widget' => "</div>\n",
'before_title' => '<h2><span>',
'after_title' => "</span></h2>\n"
));
/* box #4 of 4 */
register_sidebar( array (
'name'=>'Homepage Featured Right',
'id' => 'homepage-box-4',
'description' => 'This is the right-most box on the homepage.',
'before_widget' => '<div class="homepage widget">',
'after_widget' => "</div>\n",
'before_title' => '<h2><span>',
'after_title' => "</span></h2>\n"
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment