[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-content/themes/twentytwentyone/ -> archive.php (source)

   1  <?php
   2  /**
   3   * The template for displaying archive pages
   4   *
   5   * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
   6   *
   7   * @package WordPress
   8   * @subpackage Twenty_Twenty_One
   9   * @since Twenty Twenty-One 1.0
  10   */
  11  
  12  get_header();
  13  
  14  $description = get_the_archive_description();
  15  ?>
  16  
  17  <?php if ( have_posts() ) : ?>
  18  
  19      <header class="page-header alignwide">
  20          <?php the_archive_title( '<h1 class="page-title">', '</h1>' ); ?>
  21          <?php if ( $description ) : ?>
  22              <div class="archive-description"><?php echo wp_kses_post( wpautop( $description ) ); ?></div>
  23          <?php endif; ?>
  24      </header><!-- .page-header -->
  25  
  26      <?php while ( have_posts() ) : ?>
  27          <?php the_post(); ?>
  28          <?php get_template_part( 'template-parts/content/content', get_theme_mod( 'display_excerpt_or_full_post', 'excerpt' ) ); ?>
  29      <?php endwhile; ?>
  30  
  31      <?php twenty_twenty_one_the_posts_navigation(); ?>
  32  
  33  <?php else : ?>
  34      <?php get_template_part( 'template-parts/content/content-none' ); ?>
  35  <?php endif; ?>
  36  
  37  <?php get_footer(); ?>


Generated: Sun Dec 22 01:00:02 2024 Cross-referenced by PHPXref 0.7.1