WordPress.org

Ready to get started?Download WordPress

Forums

Custom Taxonomy and Custom Post Type Pagination giving 404 not found (3 posts)

  1. Primitive
    Member
    Posted 3 years ago #

    Hi everyone,

    I have been trying all the various solutions I have found across the web for this issue, but I still can't get it to work - so was hoping someone could shed some light on it for me.

    I'm using a custom post type called "review" and a custom taxonomy called "size" using the twentyten theme. I can display the first page of results for a certain size of review absolutely fine, but clicking on the next page link to go to page 2 of the results gives the "Not Found" message.

    This is the code I'm using to get the relevant posts:

    <?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts(array(
    'post_type'=>review,
    'gdsr_sort'=>review,
    'gdsr_order'=>DESC,
    'size'=>$term->slug,
    'posts_per_page'=>5,
    'paged'=>$paged
    )); ?>

    Any help would be very much appreciated.

  2. Primitive
    Member
    Posted 3 years ago #

    I can get the second page of results to display by adding the following to the end of the .../paged/2/ url so it looks like

    http://domain.com/taxonomy/term/paged/2/?post_type=review

    I'm already adding the post_type in the array - so is this getting lost somehow?

  3. Primitive
    Member
    Posted 3 years ago #

    I found a solution!

    In case anyone else is running into this issue, the problem seems to have arisen due to my use of More Types and More Taxonomies plugins to create the custom post type and custom taxonomies.

    To fix the issue, I simply deactivated those plugins and created the post type and taxonomy manually through my theme's functions.php following the excellent tutorials at
    http://justintadlock.com/archives/2010/04/29/custom-post-types-in-wordpress
    http://justintadlock.com/archives/2010/06/10/a-refresher-on-custom-taxonomies

    Good luck.

Topic Closed

This topic has been closed to new replies.

About this Topic