• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress a2z

WordPress a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / Files / archive.php


Lines:

1 to 40 of 40
<?php

/**
 * The template for displaying archive pages
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package WordPress
 * @subpackage Twenty_Twenty_One
 * @since Twenty Twenty-One 1.0
 */

get_header();

$description = get_the_archive_description();
?>

<?php if ( have_posts() ) : ?>

	<header class="page-header alignwide">
		<?php the_archive_title( '<h1 class="page-title">', '</h1>' ); ?>
		<?php if ( $description ) : ?>
			<div class="archive-description"><?php echo wp_kses_post( wpautop( $description ) ); ?></div>
		<?php endif; ?>
	</header><!-- .page-header -->

	<?php while ( have_posts() ) : ?>
		<?php the_post(); ?>
		<?php get_template_part( 'template-parts/content/content', get_theme_mod( 'display_excerpt_or_full_post', 'excerpt' ) ); ?>
	<?php endwhile; ?>

	<?php twenty_twenty_one_the_posts_navigation(); ?>

<?php else : ?>
	<?php get_template_part( 'template-parts/content/content-none' ); ?>
<?php endif; ?>

<?php
get_footer();
 

 View on GitHub View on Trac

Called by

    Invoked by

      Calls

      1 to 1 of 1
      • twenty_twenty_one_the_posts_navigation() – Print the next and previous posts navigation.

      Call hooks

      File name: archive.php
      Plugin ref: Twenty Twenty-One
      Version: 1.7
      Deprecated?: No
      API Letters: A,P

      Published: 9th December 2020 | Last updated: 2nd November 2022

      Primary Sidebar

      Information

      File name: archive.php
      Plugin ref: Twenty Twenty-One
      Version: 1.7
      Deprecated?: No
      API Letters: A,P

      Footer

      WordPress a2z
      WordPress a2z
      WordPress Dynamic API Reference
      WordPress 6.1.1. PHP: 8.0.27
      WordPress a2z
      WordPress core a2z
      Genesis Theme Framework a2z
      Jetpack a2z
      WordPress develop tests
      Easy Digital Downloads a2z
      WooCommerce a2z
      Yoast SEO a2z
      WordPress Blocks

      Site:  wp-a2z.org
      © Copyright WordPress a2z 2014-2023. All rights reserved.


      Website designed and developed by Herb Miller
      Proudly powered by WordPress and oik plugins

      • Home
      • Blog
      • Sitemap
      • Sites