[Resolved] wp_query and multiple post types pagination problem
2 days and a bit less hairy there it goes:
We have the following query:
global $paged; global $query_string; $arrParams = array( 'post_type' => array('post',audio','video'), 'paged' => $paged, 'posts_per_page' => 5, 'caller_get_posts'=> 1 ); $arrQuery = array(); parse_str($query_string,$arrQuery); $temp = $wp_query; $wp_query = null; $wp_query = new WP_Query(); $wp_query->query(array_merge($arrQuery, $arrParams)); while ($wp_query->have_posts()) : $wp_query->the_post(); // i display stuff ci_pagination(); // just including the next/prev links $wp_query = null; $wp_query = $temp;
Now, i have like 3 posts, 1 audio and 2 videos all of them in the same category (i have registered the post types audio and video with the ability to have categories).
The weird thing: IF the Blog pages show at most setting in the Reading Settings is smaller than my post_per_page number everything works smoothly. I move from page to page (prev/next) smoothly without any problems.
If the Blog pages show at most setting is equal or higher than my post_per_page, when u try to get to the last page of the results you get an 404. 0_o
The code above is located in category.php ( i have tried archive.php as well with no luck).
- The topic ‘[Resolved] wp_query and multiple post types pagination problem’ is closed to new replies.