Wrong "Category" items showing up in a totally different CPT
Support › MB Custom Post Type › Wrong "Category" items showing up in a totally different CPT
- This topic has 7 replies, 2 voices, and was last updated 3 years, 3 months ago by
Long Nguyen.
-
AuthorPosts
-
July 25, 2022 at 2:27 AM #37170
Steve
ParticipantHi,
I made a CPT for "Events" and another for "Notices" but the Events' categories are showing up in the Notices' categories. Shouldn't those categories be totally different? How can I get them to have different sets of categories?
Thanks,
SteveJuly 25, 2022 at 12:53 PM #37178Long Nguyen
ModeratorHi,
Can you please share some screenshots of the issue on your site? It is possible that the taxonomy
categoryis assigned to two CPTeventsandnotices.July 26, 2022 at 9:50 AM #37196Steve
ParticipantHi Long!
First off, sorry but I guess I should have said "FAQs" not "Events" ~
Sure:
Categories in Notices:
https://tinyurl.com/26nlegkqCategories in FAQs (which are right and were made first):
https://tinyurl.com/22epcm4fThey're in Korean, but you'll notice they're the same.
I didn't create a custom Category for either of them. I just made the categories in FAQs. Here's our custom taxonomies - and they all apply to "Products":
https://tinyurl.com/2bjsjzr4Any other screenshots that would be helpful?
July 26, 2022 at 9:59 AM #37197Steve
ParticipantHmmm,
And here's the Categories for the Posts:
https://tinyurl.com/22zlc6w3But here are the categories for Products:
https://tinyurl.com/26eudnzmShouldn't each CPT get it's own set of "Categories"? Why are the same "Categories" being duplicated for Posts, FAQs, Notices, etc.?
Thanks Long!
July 26, 2022 at 10:28 PM #37216Long Nguyen
ModeratorHi,
Please understand that the Plural/Singular name of the taxonomy can be the same but the slug is different. WooCommerce product category has the same Plural name as the Post category but has a different slug
product_cat. You can see it in the URL https://monosnap.com/file/oO8j6PCtT9wMyTDlvwyGDxoDXgT4EHJuly 27, 2022 at 10:33 AM #37227Steve
ParticipantHi Long,
That's great info!
But now how do I change the Notice category URL to notice_cat? What's the step I need to take? I get that the URL is different, but how do I change the URL for each CPT?
Thanks,
SteveJuly 27, 2022 at 10:52 AM #37228Steve
ParticipantHi Again Long,
Does that mean I need to create a Custom Taxonomy for each CPT to get them to have different categories? Then they can't be called "Categories", right? They have to have their own taxonomy name?
July 28, 2022 at 11:13 AM #37246Long Nguyen
ModeratorHi,
You can change the Notice category slug to
notice_catby going to Meta Box > Custom Taxonomies > Edit Notice and change the slug. The taxonomies can have the same Plural/Singular name but must have different slugs, the slug must be unique. You can read more here https://developer.wordpress.org/reference/functions/register_taxonomy/
and the section Reserved terms. -
AuthorPosts
- You must be logged in to reply to this topic.