srikat icon

Untitled

srikat | PRO | 08/25/17 01:08:48 AM UTC | 0 ⭐ | 410 👁️ | Never ⏰ | []
text |

1.52 KB

|

None

|

0 👍

/

0 👎

<?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();

Comments