Remove Unneeded the_post/rewind_posts() calls, Add a "No posts for this archive" type message to the loop. See #9015

git-svn-id: https://develop.svn.wordpress.org/trunk@13218 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2010-02-19 10:41:15 +00:00
parent 897529ea59
commit ec9ee88c2d
2 changed files with 10 additions and 4 deletions

View File

@ -3,13 +3,9 @@
<div id="container">
<div id="content">
<?php the_post(); ?>
<h1 class="page-title"><?php _e( 'Category Archives:', 'twentyten' ); ?> <span><?php single_cat_title(); ?></span></span></h1>
<?php $categorydesc = category_description(); if ( !empty($categorydesc) ) echo apply_filters( 'archive_meta', '<div class="archive-meta">' . $categorydesc . '</div>' ); ?>
<?php rewind_posts(); ?>
<?php get_generic_template( 'loop', 'category' ); ?>
</div><!-- #content -->

View File

@ -5,6 +5,16 @@
</div><!-- #nav-above -->
<?php } ?>
<?php if ( ! have_posts() ) : ?>
<div id="post-0" class="post error404 not-found">
<h1 class="entry-title"><?php _e( 'Not Found', 'twentyten' ); ?></h1>
<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found for the requested Archive. Perhaps searching will help find a related post.', 'twentyten' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</div><!-- #post-0 -->
<?php endif; ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php if ( in_category( 'Gallery' ) ) { ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>