Black Friday Sale! Get $20 off GP Premium, $40 off our new Lifetime license, and 45% off license renewals/extensions! Learn more

[Resolved] Page not found in custom post type archive

Home Forums Support Page not found in custom post type archive

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #493920
    George

    Hello. New GP Premium user here, loving the theme so far!

    I got a strange issue that is impossible to solve. I have created a custom post type called “video” with the Custom Post Type UI plugin, set it to have an archive and also to have the native categories and tags as taxonomies but when I visit that archive page I get a page not found.

    Another thing that is probably related to this is also very strange. All tag and categories that have been created are visible in both the native post type and the custom post type! Also when I create a new category for the custom post type, the same category is visible in the native post type and vice versa!

    I really don’t know what’s going on.

    I have added custom post type posts to a category called Videos. This category for some reason cannot be deleted and it is also visible in the native posts taxonomy list on the admin(cannot be deleted from there either).

    GeneratePress 2.0.2
    GP Premium 1.5.6
    #494033
    Tom
    Lead Developer
    Lead Developer

    Sometimes after creating a new CPT, you need to re-save your permalinks. Go to “Settings > Permalinks” and hit the save button.

    As for the terms, it’s hard to tell. It could be the way they’re initiating the custom taxonomy/terms? Might be worth asking the plugin developer.

    #494501
    George

    Ok thanks Tom. I have sorted the archive issue.
    For other users that might have a similar problem:

    Out of the box, WordPress does not include custom post types in the archives for the default categories and tags archives. Because of this, you need to add the post types to the query yourself using the code found on this page.

    I still haven’t resolved the duplicated tags and categories issue though, I will post here again when I do!

    #494890
    Tom
    Lead Developer
    Lead Developer
    #495328
    George

    I got an answer from the developer on the second issue.

    Basically to have completely independent taxonomies for my new custom post type I would need to create new taxonomies for it with a unique slug from the UI. Label can still be category but slug should be something like “video-category”. I might actually keep it as it is just because I need to keep the category/video slug.

    Aaaaanyway, sorry for the off topic nature of the post, at least it might save some time for other users in the future!

    #495458
    Tom
    Lead Developer
    Lead Developer

    No problem! I bet it will help someone one day 🙂

    Thanks!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.