~canonical-sysadmins/wordpress/5.1

« back to all changes in this revision

Viewing changes to wp-content/themes/twentyseventeen/template-parts/post/content-image.php

  • Committer: Haw Loeung
  • Date: 2016-12-13 06:54:17 UTC
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: haw.loeung@canonical.com-20161213065417-pemlo49o7in8nmkn
New upstream version 4.7.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * Template part for displaying image posts
 
4
 *
 
5
 * @link https://codex.wordpress.org/Template_Hierarchy
 
6
 *
 
7
 * @package WordPress
 
8
 * @subpackage Twenty_Seventeen
 
9
 * @since 1.0
 
10
 * @version 1.0
 
11
 */
 
12
?>
 
13
 
 
14
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
 
15
        <?php
 
16
                if ( is_sticky() && is_home() ) :
 
17
                        echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );
 
18
                endif;
 
19
        ?>
 
20
        <header class="entry-header">
 
21
                <?php
 
22
                        if ( 'post' === get_post_type() ) :
 
23
                                echo '<div class="entry-meta">';
 
24
                                        if ( is_single() ) :
 
25
                                                twentyseventeen_posted_on();
 
26
                                        else :
 
27
                                                echo twentyseventeen_time_link();
 
28
                                                twentyseventeen_edit_link();
 
29
                                        endif;
 
30
                                echo '</div><!-- .entry-meta -->';
 
31
                        endif;
 
32
 
 
33
                        if ( is_single() ) {
 
34
                                the_title( '<h1 class="entry-title">', '</h1>' );
 
35
                        } else {
 
36
                                the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
 
37
                        }
 
38
                ?>
 
39
        </header><!-- .entry-header -->
 
40
 
 
41
        <?php if ( '' !== get_the_post_thumbnail() && ! is_single() ) : ?>
 
42
                <div class="post-thumbnail">
 
43
                        <a href="<?php the_permalink(); ?>">
 
44
                                <?php the_post_thumbnail( 'twentyseventeen-featured-image' ); ?>
 
45
                        </a>
 
46
                </div><!-- .post-thumbnail -->
 
47
        <?php endif; ?>
 
48
 
 
49
        <div class="entry-content">
 
50
 
 
51
                <?php if ( is_single() || '' === get_the_post_thumbnail() ) :
 
52
 
 
53
                        // Only show content if is a single post, or if there's no featured image.
 
54
                        /* translators: %s: Name of current post */
 
55
                        the_content( sprintf(
 
56
                                __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
 
57
                                get_the_title()
 
58
                        ) );
 
59
 
 
60
                        wp_link_pages( array(
 
61
                                'before'      => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ),
 
62
                                'after'       => '</div>',
 
63
                                'link_before' => '<span class="page-number">',
 
64
                                'link_after'  => '</span>',
 
65
                        ) );
 
66
 
 
67
                endif; ?>
 
68
 
 
69
        </div><!-- .entry-content -->
 
70
 
 
71
        <?php if ( is_single() ) : ?>
 
72
                <?php twentyseventeen_entry_footer(); ?>
 
73
        <?php endif; ?>
 
74
 
 
75
</article><!-- #post-## -->