page_index.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * This file adds the Category Index to the Captivating Theme.
  4. *
  5. * @package Captivating
  6. * @link http://restored316designs.com/themes
  7. * @author Lauren Gaige // Restored 316 LLC
  8. * @copyright Copyright (c) 2015, Restored 316 LLC, Released 08/09/2017
  9. * @license GPL-2.0+
  10. */
  11. /*
  12. Template Name: Category Index
  13. */
  14. add_action( 'genesis_meta', 'captivating_category_genesis_meta' );
  15. /**
  16. * Add widget support for category index. If no widgets active, display the default loop.
  17. *
  18. */
  19. function captivating_category_genesis_meta() {
  20. if ( is_active_sidebar( 'category-index' )) {
  21. remove_action( 'genesis_loop', 'genesis_do_loop' );
  22. add_action( 'genesis_loop', 'captivating_category_sections' );
  23. add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );
  24. }
  25. }
  26. function captivating_category_sections() {
  27. genesis_widget_area( 'category-index', array(
  28. 'before' => '<div class="category-index widget-area">',
  29. 'after' => '</div>',
  30. ) );
  31. }
  32. genesis();