[wp-trac] [WordPress Trac] #20227: query_posts and is_archive conflicts

WordPress Trac wp-trac at lists.automattic.com
Tue Mar 13 11:47:10 UTC 2012


#20227: query_posts and is_archive conflicts
--------------------------+-----------------------------
 Reporter:  nhuja         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 When I add query_posts is category.php (twentyeleven) just before the
 while loop

 <?php query_posts('posts_per_page=20' ); ?>

 Then in content.php (for standard post)

 instead of

 <?php if ( is_search() ) : // Only display Excerpts for Search ?>

 This works fine. Replace it by

 <?php if ( is_archive() ) : // Only display Excerpts for Archive pages ?>

 It doesn't show excerpt.

 Interestingly, when using

 <?php $my_query = new WP_Query('posts_per_page=20'); ?>

 is_archive seems to work.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20227>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list