[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

   1  <?php
   2  /**
   3   * The main template file
   4   *
   5   * This is the most generic template file in a WordPress theme
   6   * and one of the two required files for a theme (the other being style.css).
   7   * It is used to display a page when nothing more specific matches a query.
   8   * E.g., it puts together the home page when no home.php file exists.
   9   *
  10   * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  11   *
  12   * @package WordPress
  13   * @subpackage Twenty_Twenty_One
  14   * @since Twenty Twenty-One 1.0
  15   */
  16  
  17  get_header(); ?>
  18  
  19  <?php if ( is_home() && ! is_front_page() && ! empty( single_post_title( '', false ) ) ) : ?>
  20      <header class="page-header alignwide">
  21          <h1 class="page-title"><?php single_post_title(); ?></h1>
  22      </header><!-- .page-header -->
  23  <?php endif; ?>
  24  
  25  <?php
  26  if ( have_posts() ) {
  27  
  28      // Load posts loop.
  29      while ( have_posts() ) {
  30          the_post();
  31  
  32          get_template_part( 'template-parts/content/content', get_theme_mod( 'display_excerpt_or_full_post', 'excerpt' ) );
  33      }
  34  
  35      // Previous/next page navigation.
  36      twenty_twenty_one_the_posts_navigation();
  37  
  38  } else {
  39  
  40      // If no content, include the "No posts found" template.
  41      get_template_part( 'template-parts/content/content-none' );
  42  
  43  }
  44  
  45  get_footer();


Generated: Sun Nov 28 01:00:03 2021 Cross-referenced by PHPXref 0.7.1