Support » Fixing WordPress » Custom post type pagination with WP-Pagenavi

  • Morhaus


    Hello everyone.
    I’m trying to make a functionnal archive for a custom post type called “video”, using the plugin “WP-PageNavi”. Here’s the content of the file “archive-video.php” :

    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    $args = array(
        'post_type' => 'video',
        'posts_per_page' => 6,
        'paged' => $paged
    $video_query = new WP_Query($args);
            // Loop content
    wp_pagenavi(array('query' => $video_query));

    The URL of the custom post type, “localhost/sitename/videos” (I changed the rewrite slug), displays well, while the URL of the custom post type’s page 2 (for example), “localhost/sitename/videos/page/2”, displays the index (Page not found).

    My permalink structure is “/%category%/%postname%”.

Viewing 1 replies (of 1 total)
  • Morhaus


    I changed the maximum number of posts per page in the configuration panel and it seems to fix the problem.

Viewing 1 replies (of 1 total)
  • The topic ‘Custom post type pagination with WP-Pagenavi’ is closed to new replies.