archive.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * This file adds the Custom Archives 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. //* Adds a CSS class to the body element
  12. add_filter( 'body_class', 'captivating_archives_body_class' );
  13. function captivating_archives_body_class( $classes ) {
  14. $classes[] = 'captivating-archives';
  15. return $classes;
  16. }
  17. //* Display as Columns
  18. add_filter( 'post_class', 'captivating_grid_post_class' );
  19. function captivating_grid_post_class( $classes ) {
  20. if ( is_main_query() ) { // conditional to ensure that column classes do not apply to Featured widgets
  21. $columns = 3; // Set the number of columns here
  22. $column_classes = array( '', '', 'one-half', 'one-third', 'one-fourth', 'one-fifth', 'one-sixth' );
  23. $classes[] = $column_classes[$columns];
  24. global $wp_query;
  25. if( 0 == $wp_query->current_post || 0 == $wp_query->current_post % $columns )
  26. $classes[] = 'first';
  27. }
  28. return $classes;
  29. }
  30. //* Remove the breadcrumb navigation
  31. remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
  32. //* Remove the post info/meta function
  33. remove_action( 'genesis_entry_header', 'genesis_post_info', 9 );
  34. remove_action( 'genesis_entry_header', 'genesis_post_meta', 12 );
  35. //* Remove the post content
  36. remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
  37. genesis();