Advertisement
srikat

Untitled

Aug 24th, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. <?php
  2. /**
  3. * This file adds the Home Page to the Pretty Theme.
  4. *
  5. * @author Lindsey Riel
  6. * @package Pretty
  7. */
  8.  
  9. //* Force full-width-content layout setting
  10. add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
  11.  
  12. add_action( 'genesis_meta', 'pretty_home_genesis_meta' );
  13. /**
  14. * Add widget support for home page. If no widgets active, display the default loop.
  15. *
  16. */
  17. function pretty_home_genesis_meta() {
  18.  
  19. // if this is a paginated page, abort.
  20. if ( is_paged() ) {
  21. return;
  22. }
  23.  
  24. if ( is_active_sidebar( 'home-featured' ) || is_active_sidebar( 'home-slider-widget' )|| is_active_sidebar( 'home-subscribe' )) {
  25.  
  26. //* Display loop after home page widgets
  27. add_action( 'genesis_after_header', 'pretty_home_widgets' );
  28.  
  29. }
  30. }
  31.  
  32. //* Add home page widgets
  33. function pretty_home_widgets() {
  34.  
  35. echo '<div id="home-page-widgets">';
  36.  
  37. genesis_widget_area( 'home-featured', array(
  38. 'before' => '<div id="home-featured" class="home-featured"><div class="widget-area"><div class="wrap">',
  39. 'after' => '</div></div></div>',
  40. ) );
  41.  
  42. genesis_widget_area( 'home-slider-widget', array(
  43. 'before' => '<div id="home-slider-widget" class="home-slider-widget"><div class="widget-area"><div class="wrap">',
  44. 'after' => '</div></div></div>',
  45. ) );
  46.  
  47. genesis_widget_area( 'home-subscribe', array(
  48. 'before' => '<div id="home-subscribe" class="home-subscribe"><div class="widget-area"><div class="wrap">',
  49. 'after' => '</div></div></div>',
  50. ) );
  51.  
  52.  
  53. echo "</div>";
  54.  
  55. }
  56.  
  57. genesis();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement