WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Type and Taxonomy pagination permalink 404 error (4 posts)

  1. silverks
    Member
    Posted 3 years ago #

    Hi guys,

    I'm customising my theme for a client, and trying to get the permalink to work.

    The website basically has 1 custom post type called herve_recipe, and a few custom taxonomies, one of them being recipe-category. Both of these custom post type and custom taxonomy has a rewrite rule with the same slug 'recette' with with_front set to false for both.

    The permalink structure is: /%category%/%postname%/
    I am also using the Custom Post Permalinks plugin by John P. Bloch, with the permalink structure set to: /recette/%recipe-category%/%herve_recipe%/

    The same slug and the plugin allows the URL to be:
    http://www.hervecuisine.com/recette/plats/ - for taxonomy archive page for the term plats of the recipe-category taxonomy.
    http://www.hervecuisine.com/recette/plats/lasagnes-a-la-bolognaise/ - for the herve_recipe custom post type assigned to the plats recipe-category.

    The only problem is that the pagination of the taxonomy archive page yields a 404 error, i.e. http://www.hervecuisine.com/recette/plats/ works but http://www.hervecuisine.com/recette/plats/page/2/ yields a 404 error.

    I'm thinking the same slug for the custom post type and custom taxonomy is the culprit, but that's the only way to have the URL as the client wanted.

    Any help would be greatly appreciated.

    Thanks.

  2. John P. Bloch
    Member
    Posted 3 years ago #

    Try changing the permalink from /recette/%recipe-category%/%herve_recipe%/ to /%post_type%/%recipe-category%/%herve_recipe%/.

  3. markvanwijnen
    Member
    Posted 2 years ago #

    Could you send me the Custom Post Permalink plugin please?

  4. eveevans
    Member
    Posted 2 years ago #

    I founded the solution here > http://walrusinacanoe.com/web-development/742

    in your function.php :

    add_action( 'parse_query','changept' );
    function changept() {
    if( is_category() && !is_admin() )
    set_query_var( 'post_type', array( 'post', 'your_custom_type' ) );
    return;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic