Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * This file adds the Home Page to the Pretty Theme.
- *
- * @author Lindsey Riel
- * @package Pretty
- */
- //* Force full-width-content layout setting
- add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
- add_action( 'genesis_meta', 'pretty_home_genesis_meta' );
- /**
- * Add widget support for home page. If no widgets active, display the default loop.
- *
- */
- function pretty_home_genesis_meta() {
- // if this is a paginated page, abort.
- if ( is_paged() ) {
- return;
- }
- if ( is_active_sidebar( 'home-featured' ) || is_active_sidebar( 'home-slider-widget' )|| is_active_sidebar( 'home-subscribe' )) {
- //* Display loop after home page widgets
- add_action( 'genesis_after_header', 'pretty_home_widgets' );
- }
- }
- //* Add home page widgets
- function pretty_home_widgets() {
- echo '<div id="home-page-widgets">';
- genesis_widget_area( 'home-featured', array(
- 'before' => '<div id="home-featured" class="home-featured"><div class="widget-area"><div class="wrap">',
- 'after' => '</div></div></div>',
- ) );
- genesis_widget_area( 'home-slider-widget', array(
- 'before' => '<div id="home-slider-widget" class="home-slider-widget"><div class="widget-area"><div class="wrap">',
- 'after' => '</div></div></div>',
- ) );
- genesis_widget_area( 'home-subscribe', array(
- 'before' => '<div id="home-subscribe" class="home-subscribe"><div class="widget-area"><div class="wrap">',
- 'after' => '</div></div></div>',
- ) );
- echo "</div>";
- }
- genesis();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement