pagination with custom post type (getting a 404)
-
I am trying to get pagination working with the wp pagenavi plugin and a custom post type (portfolio page) in wordpress and I am having no luck.
Here is a stripped down version of my portfolio page:
<?php get_header(); ?> <?php $type = 'portfolio'; $args=array( 'post_type' => $type, 'post_status' => 'publish', 'paged' => $paged, 'posts_per_page' => 1, 'caller_get_posts'=> 1 ); $temp = $wp_query; // assign original query to temp variable for later use $wp_query = null; $wp_query = new WP_Query($args); ?> <?php if($wp_query->have_posts()) : while($wp_query->have_posts()) : $wp_query->the_post(); ?> ... <?php endwhile; else : ?> ... <?php endif; ?> <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } $wp_query = null; $wp_query = $temp; ?> <?php get_footer(); ?>
I have my permalinks structure set to:
/%postname%/
and I have re-saved them.
When I go to page 2 of my portfolio, I get a 404 page. Any idea why this is happening?
Thanks for the help.
Viewing 14 replies - 1 through 14 (of 14 total)
Viewing 14 replies - 1 through 14 (of 14 total)
- The topic ‘pagination with custom post type (getting a 404)’ is closed to new replies.