[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-content/themes/twentytwelve/ -> category.php (source)

   1  <?php
   2  /**
   3   * The template for displaying Category pages
   4   *
   5   * Used to display archive-type pages for posts in a category.
   6   *
   7   * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
   8   *
   9   * @package WordPress
  10   * @subpackage Twenty_Twelve
  11   * @since Twenty Twelve 1.0
  12   */
  13  
  14  get_header(); ?>
  15  
  16      <section id="primary" class="site-content">
  17          <div id="content" role="main">
  18  
  19          <?php if ( have_posts() ) : ?>
  20              <header class="archive-header">
  21                  <h1 class="archive-title">
  22                  <?php
  23                  /* translators: %s: category title */
  24                  printf( __( 'Category Archives: %s', 'twentytwelve' ), '<span>' . single_cat_title( '', false ) . '</span>' );
  25                  ?>
  26                  </h1>
  27  
  28              <?php if ( category_description() ) : // Show an optional category description ?>
  29                  <div class="archive-meta"><?php echo category_description(); ?></div>
  30              <?php endif; ?>
  31              </header><!-- .archive-header -->
  32  
  33              <?php
  34              /* Start the Loop */
  35              while ( have_posts() ) :
  36                  the_post();
  37  
  38                  /* Include the post format-specific template for the content. If you want to
  39                   * this in a child theme then include a file called content-___.php
  40                   * (where ___ is the post format) and that will be used instead.
  41                   */
  42                  get_template_part( 'content', get_post_format() );
  43  
  44              endwhile;
  45  
  46              twentytwelve_content_nav( 'nav-below' );
  47              ?>
  48  
  49          <?php else : ?>
  50              <?php get_template_part( 'content', 'none' ); ?>
  51          <?php endif; ?>
  52  
  53          </div><!-- #content -->
  54      </section><!-- #primary -->
  55  
  56  <?php get_sidebar(); ?>
  57  <?php get_footer(); ?>


Generated: Thu Jul 18 01:00:03 2019 Cross-referenced by PHPXref 0.7.1