[wp-trac] [WordPress Trac] #19985: Query_posts paged not working for subcategories when mixing custom post types

WordPress Trac wp-trac at lists.automattic.com
Tue Feb 7 22:17:40 UTC 2012


#19985: Query_posts paged not working for subcategories when mixing custom post
types
--------------------------+--------------------------------
 Reporter:  novakpeter    |       Owner:  mike@…
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:
Component:  Post Types    |     Version:  3.3.1
 Severity:  major         |  Resolution:
 Keywords:                |
--------------------------+--------------------------------
Changes (by novakpeter):

 * cc: novakpeter (added)
 * status:  closed => reopened
 * resolution:  invalid =>
 * severity:  normal => major


Comment:

 I made it simpler to show the bug (pagination is just a secondary thing):

 {{{
        $page = (get_query_var('paged')) ? get_query_var('paged') : 1;

        if (is_category('news') OR is_category('events')){
         query_posts(array('paged' => $page));
        }

        if(have_posts()) : while(have_posts()) : the_post();
 }}}

 The whole listing is bad if you are in "events" subcategory! In "news"
 category, it lists posts from "news" category (and pagination works) - OK.
 In "events" category (which is subcategory of "news"), it lists posts from
 "news"(!!!) category (and pagination doesnt work) - BUG. I thing this
 simple thing just should work (the same way for category and subcategory).

 What do you mean by hooking initial query, do you mean hooking
 pre_get_posts?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19985#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list