[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

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

   1  <?php
   2  /**
   3   * Displays the post header
   4   *
   5   * @package WordPress
   6   * @subpackage Twenty_Twenty
   7   * @since Twenty Twenty 1.0
   8   */
   9  
  10  $entry_header_classes = '';
  11  
  12  if ( is_singular() ) {
  13      $entry_header_classes .= ' header-footer-group';
  14  }
  15  
  16  ?>
  17  
  18  <header class="entry-header has-text-align-center<?php echo esc_attr( $entry_header_classes ); ?>">
  19  
  20      <div class="entry-header-inner section-inner medium">
  21  
  22          <?php
  23              /**
  24               * Allow child themes and plugins to filter the display of the categories in the entry header.
  25               *
  26               * @since Twenty Twenty 1.0
  27               *
  28               * @param bool   Whether to show the categories in header, Default true.
  29               */
  30          $show_categories = apply_filters( 'twentytwenty_show_categories_in_entry_header', true );
  31  
  32          if ( true === $show_categories && has_category() ) {
  33              ?>
  34  
  35              <div class="entry-categories">
  36                  <span class="screen-reader-text"><?php _e( 'Categories', 'twentytwenty' ); ?></span>
  37                  <div class="entry-categories-inner">
  38                      <?php the_category( ' ' ); ?>
  39                  </div><!-- .entry-categories-inner -->
  40              </div><!-- .entry-categories -->
  41  
  42              <?php
  43          }
  44  
  45          if ( is_singular() ) {
  46              the_title( '<h1 class="entry-title">', '</h1>' );
  47          } else {
  48              the_title( '<h2 class="entry-title heading-size-1"><a href="' . esc_url( get_permalink() ) . '">', '</a></h2>' );
  49          }
  50  
  51          $intro_text_width = '';
  52  
  53          if ( is_singular() ) {
  54              $intro_text_width = ' small';
  55          } else {
  56              $intro_text_width = ' thin';
  57          }
  58  
  59          if ( has_excerpt() && is_singular() ) {
  60              ?>
  61  
  62              <div class="intro-text section-inner max-percentage<?php echo $intro_text_width; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>">
  63                  <?php the_excerpt(); ?>
  64              </div>
  65  
  66              <?php
  67          }
  68  
  69          // Default to displaying the post meta.
  70          twentytwenty_the_post_meta( get_the_ID(), 'single-top' );
  71          ?>
  72  
  73      </div><!-- .entry-header-inner -->
  74  
  75  </header><!-- .entry-header -->


Generated : Fri May 29 08:20:01 2020 Cross-referenced by PHPXref