[ 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  if ( have_posts() ) {
  20  
  21      // Load posts loop.
  22      while ( have_posts() ) {
  23          the_post();
  24  
  25          get_template_part( 'template-parts/content/content', get_theme_mod( 'display_excerpt_or_full_post', 'excerpt' ) );
  26      }
  27  
  28      // Previous/next page navigation.
  29      twenty_twenty_one_the_posts_navigation();
  30  
  31  } else {
  32  
  33      // If no content, include the "No posts found" template.
  34      get_template_part( 'template-parts/content/content-none' );
  35  
  36  }
  37  
  38  get_footer();


Generated: Mon Jan 25 01:00:03 2021 Cross-referenced by PHPXref 0.7.1