Advertisement
RobinKWilliams

Home.php

May 29th, 2013
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. <?php
  2.  
  3. add_action( 'genesis_meta', 'goinggreen_home_genesis_meta' );
  4. /**
  5. * Add widget support for homepage. If no widgets active, display the default loop.
  6. *
  7. */
  8. function goinggreen_home_genesis_meta() {
  9.  
  10. if ( is_active_sidebar( 'home-featured' ) || is_active_sidebar( 'home-1' ) || is_active_sidebar( 'home-2' ) || is_active_sidebar( 'home-3' ) || is_active_sidebar( 'home-4' ) ) {
  11.  
  12. remove_action( 'genesis_loop', 'genesis_do_loop' );
  13. add_action( 'genesis_loop', 'goinggreen_home_featured' );
  14. add_action( 'genesis_before_footer', 'goinggreen_home_sections', 3 );
  15. add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
  16. add_filter( 'body_class', 'add_body_class' );
  17.  
  18. function add_body_class( $classes ) {
  19. $classes[] = 'goinggreen';
  20. return $classes;
  21. }
  22.  
  23. }
  24. }
  25.  
  26. function goinggreen_home_featured() {
  27.  
  28. if ( is_active_sidebar( 'home-featured' ) ) {
  29. genesis_widget_area( 'home-featured', array(
  30. 'before' => '<div class="home-featured widget-area">'
  31. ) );
  32. }
  33.  
  34. }
  35.  
  36. remove_action( 'genesis_loop', 'genesis_do_loop' );
  37.  
  38.  
  39. genesis();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement