Skip Navigation

[Resolved] Primary category

This support ticket is created 5 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 5 years, 5 months ago.

Assisted by: Nigel.

Author
Posts
#1266475

Hi, I was wondering if I could somehow mark a category as being a Primary category

The use case is, I have a list of articles (a custom post type) with a taxonomy assigned to it.

I have created a view which shows the custom post type with a label showing what category it is. The issue is when it is in multiple categories. I only want to show 1 category label. Is there some way I can promote or allow the user to assign the category I want to show as a primary category

I.e The post has Cat A, Cat B and Cat D assigned to it I want the label for cat D to show.

Thanks!

#1266687

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

It's hard to see how you could do this with a single taxonomy. It might be possible to contrive something if Cat D was always the primary category, but some posts won't even have it assigned, and on those where it is assigned it won't always be the primary category.

The only way I envisage this working is to have two taxonomies, one of which is "primary category", the second being "other categories". The terms would be the same in each.

Users would assign a term from the primary category, and optionally more terms from the other categories, and you would only show the label for the primary category.