|
1 <?php |
|
2 /** |
|
3 * Template part for displaying posts with excerpts |
|
4 * |
|
5 * Used in Search Results and for Recent Posts in Front Page panels. |
|
6 * |
|
7 * @link https://codex.wordpress.org/Template_Hierarchy |
|
8 * |
|
9 * @package WordPress |
|
10 * @subpackage Twenty_Seventeen |
|
11 * @since 1.0 |
|
12 * @version 1.2 |
|
13 */ |
|
14 |
|
15 ?> |
|
16 |
|
17 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
|
18 |
|
19 <header class="entry-header"> |
|
20 <?php if ( 'post' === get_post_type() ) : ?> |
|
21 <div class="entry-meta"> |
|
22 <?php |
|
23 echo twentyseventeen_time_link(); |
|
24 twentyseventeen_edit_link(); |
|
25 ?> |
|
26 </div><!-- .entry-meta --> |
|
27 <?php elseif ( 'page' === get_post_type() && get_edit_post_link() ) : ?> |
|
28 <div class="entry-meta"> |
|
29 <?php twentyseventeen_edit_link(); ?> |
|
30 </div><!-- .entry-meta --> |
|
31 <?php endif; ?> |
|
32 |
|
33 <?php if ( is_front_page() && ! is_home() ) { |
|
34 |
|
35 // The excerpt is being displayed within a front page section, so it's a lower hierarchy than h2. |
|
36 the_title( sprintf( '<h3 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h3>' ); |
|
37 } else { |
|
38 the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); |
|
39 } ?> |
|
40 </header><!-- .entry-header --> |
|
41 |
|
42 <div class="entry-summary"> |
|
43 <?php the_excerpt(); ?> |
|
44 </div><!-- .entry-summary --> |
|
45 |
|
46 </article><!-- #post-## --> |