Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Zilla

    (@dawnzillamonster)

    I should clarify – /page/2 from index goes to a 404 message.

    The index is pulling my custom post type using
    <?php query_posts('post_type=photos'); ?>

    When I go to /page/2 of a custom post type archive page, the page displays the same posts that were on the first page.

    Thread Starter Zilla

    (@dawnzillamonster)

    Updating my own thread here…

    Got the archive pages to paginate correctly by adding
    'paged' => $paged
    to my $args

    Still trying to work out pagination from the index though.

    Thread Starter Zilla

    (@dawnzillamonster)

    Fixed!

    Removed query from index (actually, got rid of custom index.php completely) then hooked into ‘pre_get_posts’ in functions.php as described here:

    https://codex.ww.wp.xz.cn/Pagination#Removing_query_posts_from_the_main_loop

    Now have pagination working correctly everywhere.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Pagination problem with CPT-onomy archives’ is closed to new replies.