Why is “/page/2/” not working?

Finally got pagination to work with the below code, but now the pagination links to /videos/page/2/, which doesn’t exist. How do I get page 2 to work?

$temp = $wp_query;
$wp_query= null;
$wp_query = new WP_Query();

while ($wp_query->have_posts()) : $wp_query->the_post();
  //display stuff

php  wp_pagenavi();


Found the answer:

After a looong day debugging thru wordpress core, I managed to solve
this issue.

Basicly, you CANT have a PAGE and a CUSTOM POST TYPE with the same
name. If you do, the permalink rewrite rules will get confused and
trigger a 404.

A very simple solution I’m using is: The page that lists the custom
post types is called in plural (eg. products) and the actual post type
name is in singular (eg. product). So they dont conflict and it’s all

Done Done! Hope this will save people’s time.

  • via rafaelxy (http://wordpress.org/support/topic/pagination-with-custom-post-type-listing)

Leave a Comment