[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

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

   1  <?php
   2  /**
   3   * 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   * Learn more: https://developer.wordpress.org/themes/basics/template-hierarchy/
  10   *
  11   * @package WordPress
  12   * @subpackage Twenty_Eleven
  13   */
  14  
  15  get_header(); ?>
  16  
  17          <div id="primary">
  18              <div id="content" role="main">
  19  
  20              <?php if ( have_posts() ) : ?>
  21  
  22                  <?php twentyeleven_content_nav( 'nav-above' ); ?>
  23  
  24                  <?php
  25                  // Start the Loop.
  26                  while ( have_posts() ) :
  27                      the_post();
  28                      ?>
  29  
  30                      <?php get_template_part( 'content', get_post_format() ); ?>
  31  
  32                  <?php endwhile; ?>
  33  
  34                  <?php twentyeleven_content_nav( 'nav-below' ); ?>
  35  
  36              <?php else : ?>
  37  
  38                  <article id="post-0" class="post no-results not-found">
  39                      <header class="entry-header">
  40                          <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
  41                      </header><!-- .entry-header -->
  42  
  43                      <div class="entry-content">
  44                          <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
  45                          <?php get_search_form(); ?>
  46                      </div><!-- .entry-content -->
  47                  </article><!-- #post-0 -->
  48  
  49              <?php endif; ?>
  50  
  51              </div><!-- #content -->
  52          </div><!-- #primary -->
  53  
  54  <?php get_sidebar(); ?>
  55  <?php get_footer(); ?>


Generated : Thu Nov 21 08:20:01 2024 Cross-referenced by PHPXref