3 * Displays content for front page
6 * @subpackage Twenty_Seventeen
12 <article id="post-<?php the_ID(); ?>" <?php post_class( 'twentyseventeen-panel ' ); ?> >
14 <?php if ( has_post_thumbnail() ) :
15 $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'twentyseventeen-featured-image' );
17 $post_thumbnail_id = get_post_thumbnail_id( $post->ID );
19 $thumbnail_attributes = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'twentyseventeen-featured-image' );
21 // Calculate aspect ratio: h / w * 100%.
22 $ratio = $thumbnail_attributes[2] / $thumbnail_attributes[1] * 100;
25 <div class="panel-image" style="background-image: url(<?php echo esc_url( $thumbnail[0] ); ?>);">
26 <div class="panel-image-prop" style="padding-top: <?php echo esc_attr( $ratio ); ?>%"></div>
27 </div><!-- .panel-image -->
31 <div class="panel-content">
33 <header class="entry-header">
34 <?php the_title( '<h2 class="entry-title">', '</h2>' ); ?>
36 <?php twentyseventeen_edit_link( get_the_ID() ); ?>
38 </header><!-- .entry-header -->
40 <div class="entry-content">
42 /* translators: %s: Name of current post */
44 __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
48 </div><!-- .entry-content -->
51 </div><!-- .panel-content -->
53 </article><!-- #post-## -->