[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-content/themes/twentytwenty/template-parts/ -> content.php (source)

   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( sprintf( '<span class="faux-button">%1$s</span> <span class="screen-reader-text">"%2$s"</span>', __( 'Continue reading', 'twentytwenty' ), get_the_title() ) );
  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 -->


Generated: Fri Oct 25 08:20:01 2019 Cross-referenced by PHPXref 0.7