content-featured-post.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * The template for displaying featured posts on the front page
  4. *
  5. * @package WordPress
  6. * @subpackage Twenty_Fourteen
  7. * @since Twenty Fourteen 1.0
  8. */
  9. ?>
  10. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  11. <a class="post-thumbnail" href="<?php the_permalink(); ?>">
  12. <?php
  13. // Output the featured image.
  14. if ( has_post_thumbnail() ) :
  15. if ( 'grid' == get_theme_mod( 'featured_content_layout' ) ) {
  16. the_post_thumbnail();
  17. } else {
  18. the_post_thumbnail( 'twentyfourteen-full-width' );
  19. }
  20. endif;
  21. ?>
  22. </a>
  23. <header class="entry-header">
  24. <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?>
  25. <div class="entry-meta">
  26. <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span>
  27. </div><!-- .entry-meta -->
  28. <?php endif; ?>
  29. <?php the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">','</a></h1>' ); ?>
  30. </header><!-- .entry-header -->
  31. </article><!-- #post-## -->