Pagination issue for Custom Post type in wordpress 3.0

Hello!

There are several issues with custom post types and pagination. One of them can be solved by adding a post_type var to the url vars.

Example: example.com/category/books/page/2/?post_type=novels

Use this in your functions.php:

function custom_request($qv) {
if(isset($qs[‘category_name’])){
$qs[‘post_type’] = get_post_types($args = array(
‘public’ => true,
’_builtin’ => false
));
array_push($qs[‘post_type’],‘post’);
}
return $qs;
}
add_filter(‘request’, ‘custom_request’);

It also works for Author’s Archive, Feeds, and other places where you need the custom post types to appear.