2013-07-29 00:55:10 +02:00
< ? php
/**
2013-10-12 00:02:11 +02:00
* The template for displaying featured posts on the front page
*
2013-07-29 00:55:10 +02:00
* @ package WordPress
* @ subpackage Twenty_Fourteen
2013-10-12 00:02:11 +02:00
* @ since Twenty Fourteen 1.0
2013-07-29 00:55:10 +02:00
*/
?>
2013-08-15 05:13:29 +02:00
< article id = " post-<?php the_ID(); ?> " < ? php post_class (); ?> >
2013-10-09 21:07:09 +02:00
< a class = " attachment-featured-featured " href = " <?php the_permalink(); ?> " rel = " <?php the_ID(); ?> " >
2013-07-29 00:55:10 +02:00
< ? php
2013-08-15 05:13:29 +02:00
if ( has_post_thumbnail () ) :
2013-07-29 00:55:10 +02:00
the_post_thumbnail ( 'featured-thumbnail-featured' );
2013-08-15 05:13:29 +02: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-29 00:55:10 +02:00
endif ;
?>
</ a >
< div class = " entry-wrap " >
< header class = " entry-header " >
2013-08-15 05:13:29 +02:00
< ? php if ( in_array ( 'category' , get_object_taxonomies ( get_post_type () ) ) && twentyfourteen_categorized_blog () ) : ?>
2013-07-29 00:55:10 +02:00
< div class = " entry-meta " >
2013-08-15 05:13:29 +02: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-29 00:55:10 +02:00
</ div ><!-- . entry - meta -->
2013-08-15 05:13:29 +02:00
< ? php endif ; ?>
< ? php the_title ( '<h1 class="entry-title"><a href="' . esc_url ( get_permalink () ) . '" rel="bookmark">' , '</a></h1>' ); ?>
2013-07-29 00:55:10 +02:00
</ header ><!-- . entry - header -->
</ div >
2013-08-15 05:13:29 +02:00
</ article ><!-- #post-## -->