mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Remove Unneeded the_post/rewind_posts() calls, Add a "No posts for this archive" type message to the loop. See #9015
git-svn-id: http://svn.automattic.com/wordpress/trunk@13218 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
35cdac687c
commit
c402ed54bb
@ -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 -->
|
||||
|
@ -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(); ?>>
|
||||
|
Loading…
Reference in New Issue
Block a user