featured-content.php 945 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * The template for displaying featured content
  4. *
  5. * @package WordPress
  6. * @subpackage Twenty_Fourteen
  7. * @since Twenty Fourteen 1.0
  8. */
  9. ?>
  10. <div id="featured-content" class="featured-content">
  11. <div class="featured-content-inner">
  12. <?php
  13. /**
  14. * Fires before the Twenty Fourteen featured content.
  15. *
  16. * @since Twenty Fourteen 1.0
  17. */
  18. do_action( 'twentyfourteen_featured_posts_before' );
  19. $featured_posts = twentyfourteen_get_featured_posts();
  20. foreach ( (array) $featured_posts as $order => $post ) :
  21. setup_postdata( $post );
  22. // Include the featured content template.
  23. get_template_part( 'content', 'featured-post' );
  24. endforeach;
  25. /**
  26. * Fires after the Twenty Fourteen featured content.
  27. *
  28. * @since Twenty Fourteen 1.0
  29. */
  30. do_action( 'twentyfourteen_featured_posts_after' );
  31. wp_reset_postdata();
  32. ?>
  33. </div><!-- .featured-content-inner -->
  34. </div><!-- #featured-content .featured-content -->