[ 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">
  37                      <?php
  38                      /* translators: Hidden accessibility text. */
  39                      _e( 'Categories', 'twentytwenty' );
  40                      ?>
  41                  </span>
  42                  <div class="entry-categories-inner">
  43                      <?php the_category( ' ' ); ?>
  44                  </div><!-- .entry-categories-inner -->
  45              </div><!-- .entry-categories -->
  46  
  47              <?php
  48          }
  49  
  50          if ( is_singular() ) {
  51              the_title( '<h1 class="entry-title">', '</h1>' );
  52          } else {
  53              the_title( '<h2 class="entry-title heading-size-1"><a href="' . esc_url( get_permalink() ) . '">', '</a></h2>' );
  54          }
  55  
  56          $intro_text_width = '';
  57  
  58          if ( is_singular() ) {
  59              $intro_text_width = ' small';
  60          } else {
  61              $intro_text_width = ' thin';
  62          }
  63  
  64          if ( has_excerpt() && is_singular() ) {
  65              ?>
  66  
  67              <div class="intro-text section-inner max-percentage<?php echo $intro_text_width; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>">
  68                  <?php the_excerpt(); ?>
  69              </div>
  70  
  71              <?php
  72          }
  73  
  74          // Default to displaying the post meta.
  75          twentytwenty_the_post_meta( get_the_ID(), 'single-top' );
  76          ?>
  77  
  78      </div><!-- .entry-header-inner -->
  79  
  80  </header><!-- .entry-header -->


Generated : Mon Mar 18 08:20:01 2024 Cross-referenced by PHPXref