Taxonomies archive not working

Posted in: Newspaper
Post count: 36

Hello,

I have created CPT Card which has following taxonomies card_category and card_tag. I have setup the CPT and taxonomies in the Theme Settings. However, whenever I click on the taxonomy on the single post, it is giving 404 Error In permalink, it’s looking into the category, however, as per my knowledge it should add card_category or card_tag

For example, my Card (post) has card_category Tuition the permalink for Tuition should be something like this http://site.com/card_category/tution but it is now redirecting to http://site.com/category/tution

When I checked the code and not so sure whether I understood the code correctly or not but I found you have used get_the_category() but as per my knowledge that only works with the post category and for the custom taxonomy we support to use get_the_terms().

Please let me know how can I add the custom taxonomies as well as CPT to all archives.

Post count: 36

Well, it was my mistake. I have registered taxonomy as card_category but slug was the category that was creating an issue. I have solved it. 🙂

However, I still have a question. How can I create CPT archive to list all Cards same like Post archive? Is there any setting or I have to create template?

  • This reply was modified 9 years by jatinsoni.
Post count: 20688

Hi,

I don’t understand exactly what archive you want to create. Please provide more details about what you want to achieve.

Thanks

Post count: 36

I want to list my custom post type. Its name is CARD, listing just like POST. Hope this is more clear to understand.

Post count: 20688

Hi,

You can display the custom posts in any of the theme blocks for example. The blocks have the option to filter posts by custom post type
https://forum.tagdiv.com/block-settings-guide/

Thanks

Viewing 5 posts - 1 through 5 (of 5 total)
The forum ‘Newspaper’ is closed to new topics and replies.