Created
September 11, 2013 18:09
-
-
Save PittsburghChris/6527480 to your computer and use it in GitHub Desktop.
Genesis - adding slideshow widget area and 4 smaller widget areas
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
/* 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