archive.php 995 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. get_header();
  12. $description = get_the_archive_description();
  13. ?>
  14. <?php if ( have_posts() ) : ?>
  15. <header class="page-header alignwide">
  16. <?php the_archive_title( '<h1 class="page-title">', '</h1>' ); ?>
  17. <?php if ( $description ) : ?>
  18. <div class="archive-description"><?php echo wp_kses_post( wpautop( $description ) ); ?></div>
  19. <?php endif; ?>
  20. </header><!-- .page-header -->
  21. <?php while ( have_posts() ) : ?>
  22. <?php the_post(); ?>
  23. <?php get_template_part( 'template-parts/content/content', get_theme_mod( 'display_excerpt_or_full_post', 'excerpt' ) ); ?>
  24. <?php endwhile; ?>
  25. <?php twenty_twenty_one_the_posts_navigation(); ?>
  26. <?php else : ?>
  27. <?php get_template_part( 'template-parts/content/content-none' ); ?>
  28. <?php endif; ?>
  29. <?php
  30. get_footer();