Don't like ads? PRO users don't see any ads ;-)

Category.php Mashup

By: Digitalraindrops on Apr 16th, 2012  |  syntax: PHP  |  size: 2.08 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. /**
  3.  * The template for displaying Category Archive pages.
  4.  *
  5.  * @package WordPress
  6.  * @subpackage Twenty_Eleven
  7.  * @since Twenty Eleven 1.0
  8.  */
  9.  
  10. get_header(); ?>
  11.  
  12.                 <section id="primary">
  13.                         <div id="content" role="main">
  14.  
  15.                         <?php if ( have_posts() ) : ?>
  16.  
  17.                                 <!-- Moved Header Code from Here -->
  18.  
  19.                                 <?php twentyeleven_content_nav( 'nav-above' ); ?>
  20.  
  21.                                 <?php /* Start the Loop */ ?>
  22.                                 <?php while ( have_posts() ) : the_post(); ?>
  23.  
  24.                                         <?php
  25.                                                 /* Include the Post-Format-specific template for the content.
  26.                                                  * If you want to overload this in a child theme then include a file
  27.                                                  * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  28.                                                  */
  29.                                                 get_template_part( 'content', get_post_format() );
  30.                                         ?>
  31.  
  32.                                 <?php endwhile; ?>
  33.                                
  34.                                 <!-- Moved Header Code to Here -->
  35.                                 <header class="page-header">
  36.                                         <h1 class="page-title"><?php
  37.                                                 printf( __( 'Category Archives: %s', 'twentyeleven' ), '<span>' . single_cat_title( '', false ) . '</span>' );
  38.                                         ?></h1>
  39.  
  40.                                         <?php
  41.                                                 $category_description = category_description();
  42.                                                 if ( ! empty( $category_description ) )
  43.                                                         echo apply_filters( 'category_archive_meta', '<div class="category-archive-meta">' . $category_description . '</div>' );
  44.                                         ?>
  45.                                 </header>
  46.                                 <!-- Moved Header Code to Here -->
  47.                                
  48.                                 <?php twentyeleven_content_nav( 'nav-below' ); ?>
  49.  
  50.                         <?php else : ?>
  51.  
  52.                                 <article id="post-0" class="post no-results not-found">
  53.                                         <header class="entry-header">
  54.                                                 <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
  55.                                         </header><!-- .entry-header -->
  56.  
  57.                                         <div class="entry-content">
  58.                                                 <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
  59.                                                 <?php get_search_form(); ?>
  60.                                         </div><!-- .entry-content -->
  61.                                 </article><!-- #post-0 -->
  62.  
  63.                         <?php endif; ?>
  64.  
  65.                         </div><!-- #content -->
  66.                 </section><!-- #primary -->
  67.  
  68. <?php get_sidebar(); ?>
  69. <?php get_footer(); ?>