2013-07-28 18:55:10 -04:00
< ? php
/**
2013-10-11 18:02:11 -04:00
* The template for displaying featured posts on the front page
*
2013-07-28 18:55:10 -04:00
* @ package WordPress
* @ subpackage Twenty_Fourteen
2013-10-11 18:02:11 -04:00
* @ since Twenty Fourteen 1.0
2013-07-28 18:55:10 -04:00
*/
?>
2013-08-14 23:13:29 -04:00
< article id = " post-<?php the_ID(); ?> " < ? php post_class (); ?> >
2013-10-09 15:07:09 -04:00
< a class = " attachment-featured-featured " href = " <?php the_permalink(); ?> " rel = " <?php the_ID(); ?> " >
2013-07-28 18:55:10 -04:00
< ? php
2013-08-14 23:13:29 -04:00
if ( has_post_thumbnail () ) :
2013-07-28 18:55:10 -04:00
the_post_thumbnail ( 'featured-thumbnail-featured' );
2013-08-14 23:13:29 -04:00
else :
$images = get_children ( array (
'post_parent' => get_the_ID (),
'post_type' => 'attachment' ,
'post_mime_type' => 'image' ,
'orderby' => 'menu_order' ,
'order' => 'ASC' ,
'numberposts' => 1 ,
) );
if ( $images ) :
$image = array_shift ( $images );
echo wp_get_attachment_image ( $image -> ID , 'featured-thumbnail-featured' );
endif ;
2013-07-28 18:55:10 -04:00
endif ;
?>
</ a >
< div class = " entry-wrap " >
< header class = " entry-header " >
2013-08-14 23:13:29 -04:00
< ? php if ( in_array ( 'category' , get_object_taxonomies ( get_post_type () ) ) && twentyfourteen_categorized_blog () ) : ?>
2013-07-28 18:55:10 -04:00
< div class = " entry-meta " >
2013-08-14 23:13:29 -04:00
< span class = " cat-links " >< ? php echo get_the_category_list ( _x ( ', ' , 'Used between list items, there is a space after the comma.' , 'twentyfourteen' ) ); ?> </span>
2013-07-28 18:55:10 -04:00
</ div ><!-- . entry - meta -->
2013-08-14 23:13:29 -04:00
< ? php endif ; ?>
< ? php the_title ( '<h1 class="entry-title"><a href="' . esc_url ( get_permalink () ) . '" rel="bookmark">' , '</a></h1>' ); ?>
2013-07-28 18:55:10 -04:00
</ header ><!-- . entry - header -->
</ div >
2013-08-14 23:13:29 -04:00
</ article ><!-- #post-## -->