Make WordPress Core

source: trunk/src/wp-content/themes/twentytwenty/template-parts/content.php @ 46613

Last change on this file since 46613 was 46613, checked in by desrosj, 5 years ago

Bundled Themes: Update Twenty Twenty.

This brings trunk’s version of Twenty Twenty in-sync with GitHub.

For a complete list of changes since [46571], see https://github.com/WordPress/twentytwenty/compare/4549fd9...dea9290.

Props anlino, ianbelanger, poena, williampatton, collet, erikkroes, torres126, intimez, byalextran, mehidi258, swapnild, nielslange.
Fixes #48450.

  • Property svn:eol-style set to native
File size: 1.9 KB
Line 
1<?php
2/**
3 * The default template for displaying content
4 *
5 * Used for both singular and index.
6 *
7 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
8 *
9 * @package WordPress
10 * @subpackage Twenty_Twenty
11 * @since 1.0.0
12 */
13
14?>
15
16<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
17
18        <?php
19
20        get_template_part( 'template-parts/entry-header' );
21
22        if ( ! is_search() ) {
23                get_template_part( 'template-parts/featured-image' );
24        }
25
26        ?>
27
28        <div class="post-inner section-inner <?php echo is_page_template( 'templates/template-full-width.php' ) ? '' : 'thin'; ?> ">
29
30                <div class="entry-content">
31
32                        <?php
33                        if ( is_search() || ! is_singular() && 'summary' === get_theme_mod( 'blog_content', 'full' ) ) {
34                                the_excerpt();
35                        } else {
36                                the_content( __( 'Continue reading', 'twentytwenty' ) );
37                        }
38                        ?>
39
40                </div><!-- .entry-content -->
41
42                <?php
43                wp_link_pages(
44                        array(
45                                'before'      => '<nav class="post-nav-links bg-light-background" aria-label="' . esc_attr__( 'Page', 'twentytwenty' ) . '"><span class="label">' . __( 'Pages:', 'twentytwenty' ) . '</span>',
46                                'after'       => '</nav>',
47                                'link_before' => '<span class="page-number">',
48                                'link_after'  => '</span>',
49                        )
50                );
51
52                edit_post_link();
53
54                // Single bottom post meta.
55                twentytwenty_the_post_meta( get_the_ID(), 'single-bottom' );
56
57                if ( is_single() ) {
58
59                        get_template_part( 'template-parts/entry-author-bio' );
60
61                }
62                ?>
63
64        </div><!-- .post-inner -->
65
66        <?php
67
68        if ( is_single() ) {
69
70                get_template_part( 'template-parts/navigation' );
71
72        }
73
74        /**
75         *  Output comments wrapper if it's a post, or if comments are open,
76         * or if there's a comment number – and check for password.
77         * */
78        if ( ( is_single() || is_page() ) && ( comments_open() || get_comments_number() ) && ! post_password_required() ) {
79                ?>
80
81                <div class="comments-wrapper section-inner">
82
83                        <?php comments_template(); ?>
84
85                </div><!-- .comments-wrapper -->
86
87                <?php
88        }
89        ?>
90
91</article><!-- .post -->
Note: See TracBrowser for help on using the repository browser.