[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-content/themes/twentyseventeen/template-parts/post/ -> content-excerpt.php (source)

   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://developer.wordpress.org/themes/basics/template-hierarchy/
   8   *
   9   * @package WordPress
  10   * @subpackage Twenty_Seventeen
  11   * @since Twenty Seventeen 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
  34          if ( is_front_page() && ! is_home() ) {
  35  
  36              // The excerpt is being displayed within a front page section, so it's a lower hierarchy than h2.
  37              the_title( sprintf( '<h3 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h3>' );
  38          } else {
  39              the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
  40          }
  41          ?>
  42      </header><!-- .entry-header -->
  43  
  44      <div class="entry-summary">
  45          <?php the_excerpt(); ?>
  46      </div><!-- .entry-summary -->
  47  
  48  </article><!-- #post-<?php the_ID(); ?> -->


Generated : Sun Dec 22 08:20:01 2024 Cross-referenced by PHPXref