﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
19985	Query_posts paged not working for subcategories when mixing custom post types	novakpeter	mike@w-script.com	"
{{{
       $page = (get_query_var('paged')) ? get_query_var('paged') : 1; 

       if (is_category('news') OR is_category('events')){
        query_posts(array('post_type'=>array('post','ai1ec_event'),'paged' => $page));
       }
       
       if(have_posts()) : while(have_posts()) : the_post();
}}}
 
I have this code in themes category.php. It mixes two post types, standard posts and events from All in One Events Calendar (WP plugin). It works almost perfect. ""News"" is a normal category, in this category the loop lists normal posts, events and makes a proper pagination.

""Events"" is a subcategory of ""News"". If I am in ""Events"" category, the loop lists normal posts together with events. BUT: the pagination doesnt work properly. If I click on previous_posts_link generated link, the URL is proper: 

{{{
http://www.domain.com/categories/news/events/page/2/
}}}

BUT, on the page are mixed posts from news and events category together and clicking on previous_posts_link generated link leads to page 3, which ""doesnt exist"".

SO, THE SAME CODE WORKS PERFECTLY ON A CATEGORY, FAILS PAGING ON SUBCATEGORY

If you want, I can give you FTP details to see it in action."	defect (bug)	closed	normal		Post Types	3.3.1	normal	invalid		mike@… novakpeter pavelevap@…
