• Resolved vidhun

    (@vidhun)


    I want to create a custom taxonomy which behaves similar to the post type as a category behaves to a the default posts (on the grounds of /%category%/%postname%/ permalink structure) so that the posts in the custom post types are displayed as https://www.example.com/custom-post-type/custom-taxonomy-name/post-name Also I want the category meta box to appear only when we add new default post and not when we add a new post in the custom post type and the custom taxonomy box to appear only when we add a new post in the custom post type and not when we add new a default post.

    please help

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I want to create a custom taxonomy which behaves similar to the post type as a category behaves to a the default posts (on the grounds of /%category%/%postname%/ permalink structure) so that the posts in the custom post types are displayed as https://www.example.com/custom-post-type/custom-taxonomy-name/post-name.

    Not quite certain if you’re wanting the taxonomy slug in the permalink, or if you’re wanting the term slug, for a term in the taxonomy, as part of the permalink. Can you clarify? Give the taxonomy slug you’re using and an example term, please.

    I want the category meta box to appear only when we add new default post and not when we add a new post in the custom post type and the custom taxonomy box to appear only when we add a new post in the custom post type and not when we add new a default post.

    If I’m following this one correctly, just don’t assign the custom taxonomy to the post post type, and don’t assign category taxonomy to your custom post type. Then the metaboxes for each taxonomy will only show when intended.

    Thread Starter vidhun

    (@vidhun)

    Thanks for your response Michael.

    Hope the following explanation will help to find my problem.

    i have two custom post types.

    Movie archives, and movie reviews.

    both had genre taxonomy and subcategories (drama, thriller, etc).

    while i am selecting or click “genre” archive, it shows movies from both Custom post types (movie Archives and Movie reviews)

    is it possible to show the “genre” archive from the particular custom post type
    (movie archives alone or movie reviews alone)

    https://www.example.com/custom-post-type/custom-taxonomy-name/category.
    https://www.example.com/movie_archives/genre/drama.
    or
    https://www.example.com/movie_reviews/genre/drama.

    instead of

    https://www.example.com/genre/drama. (i dont want to have a mixed archive result from both custom post types)

    • This reply was modified 3 years, 4 months ago by vidhun.
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    hmm. I’m not going to say no to that, but I am going to say it’s going to take more than CPTUI to achieve this. I’m curious if in the pre_get_posts hook, it could be possible to check the URL for which post type archive is present, and set the post types to query to be just that presented one.

    This has me intrigued now but I do not have any code ready or handy for passing along.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Taxonomy specific to a Custom Post type’ is closed to new replies.