Once Again: Page not found on second and further pages
-
Once again I’m struggling with wp-pagenavi. As I am slowly going crazy I have to ask you for help.
I am using custom Post Type “topo” and try to get als “topos” within the category “topo-locations”. The problem is, that I get a “Page not found” error when trying to visit the second page. I think there must be something wrong with my query, but I don’t get it… Seeing the “Page not found”-Page means, WordPress musst have jumped from the category.php (where this code is located) to the index.php
Works:
https://walter-hoelzler.sauer-medientechnik.de/topo-locations/page/1/
Doesn’t work:
https://walter-hoelzler.sauer-medientechnik.de/topo-locations/page/2/[ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]
$paged = get_query_var('paged') ? get_query_var('paged') : 1; $catid = get_query_var('cat'); $args = array( 'post_type' => 'topo', 'post_status' => 'publish', 'cat' => $catid, 'paged' => $paged ); query_posts( $args ); if (have_posts()) : while (have_posts()) : the_post(); //do something endwhile; else: endif; if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
- The topic ‘Once Again: Page not found on second and further pages’ is closed to new replies.