3 * Template part for displaying audio posts
5 * @link https://codex.wordpress.org/Template_Hierarchy
8 * @subpackage Twenty_Seventeen
15 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
17 if ( is_sticky() && is_home() ) :
18 echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );
21 <header class="entry-header">
23 if ( 'post' === get_post_type() ) :
24 echo '<div class="entry-meta">';
26 twentyseventeen_posted_on();
28 echo twentyseventeen_time_link();
29 twentyseventeen_edit_link();
31 echo '</div><!-- .entry-meta -->';
35 the_title( '<h1 class="entry-title">', '</h1>' );
37 the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
40 </header><!-- .entry-header -->
43 $content = apply_filters( 'the_content', get_the_content() );
46 // Only get audio from the content if a playlist isn't present.
47 if ( false === strpos( $content, 'wp-playlist-script' ) ) {
48 $audio = get_media_embedded_in_content( $content, array( 'audio' ) );
53 <?php if ( '' !== get_the_post_thumbnail() && ! is_single() ) : ?>
54 <div class="post-thumbnail">
55 <a href="<?php the_permalink(); ?>">
56 <?php the_post_thumbnail( 'twentyseventeen-featured-image' ); ?>
58 </div><!-- .post-thumbnail -->
61 <div class="entry-content">
63 <?php if ( ! is_single() ) :
65 // If not a single post, highlight the audio file.
66 if ( ! empty( $audio ) ) :
67 foreach ( $audio as $audio_html ) {
68 echo '<div class="entry-audio">';
70 echo '</div><!-- .entry-audio -->';
76 if ( is_single() || empty( $audio ) ) :
78 /* translators: %s: Name of current post */
80 __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
85 'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ),
87 'link_before' => '<span class="page-number">',
88 'link_after' => '</span>',
93 </div><!-- .entry-content -->
95 <?php if ( is_single() ) : ?>
96 <?php twentyseventeen_entry_footer(); ?>
99 </article><!-- #post-## -->