Skip Navigation

[Resolved] CSS colorstyling of taxonomies

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 8 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 6 replies, has 2 voices.

Last updated by John Mac 8 years, 3 months ago.

Assisted by: Shane.

Author
Posts
#423211

I am trying to:
We got a custom post type called Innovations. That post type uses a taxonomy called "Sectors." There are 12 sectors.

When displaying the different innovations in the page below, we would like to have the 12 sectors show a unique color on each post. So that is, each of the 12 sectors has their own color.

You see each post is displayed with it's sector name in text. But where the yellow dot is, the unique color for that sector should be shown.

How can we do this? How can each sector be assigned with a unique color?

I visited this URL:
hidden link

(as of writing, the hosting company has some DB problems... )

Johnny 🙂

#423287

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Johnny,

Thank you for contacting our support forum.

Let me see how best I can assist you with this 🙂

Our Types plugin has the ability to add custom fields to taxonomy terms. So what you can do is to add a custom field for color and then you can add the hexcode for that color there.

On the Frontend you can just retrieve the color.

What kind of view are you listing out the items in. Is it a taxonomy view or a Post view.

Please let me know.
Thanks,
Shane

#423480

Hello Shane,

Okey, I see. Hm, so which one of these would I use or that? Post Fields, User Fields or Term Fields. And I guess you don't mean like using the colorpicker function as field?

I have built a View for a parametric search.

Johnny

#423551

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Johnny,

You will use the Post Meta option and then add a single line text field.

With this you can then add the hexcode for the color in the single line field 🙂

You can use the link below to get the hexcode.
hidden link

Once you have done this please let me know 🙂
Thanks,
Shane

#423614

Hm, I can't find any "Post Meta" option.

What I have tried now is using Term Fields and created a field with online line text. I assigned this to the taxonomy "Sector". I now see this field when editing the Sector tax'es.
hidden link

I have then added this field to the output in "Templates for this View":
hidden link

But I don't get any output when looking at the frontend code.

#423865

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screen Shot 2016-08-11 at 9.29.27 AM.png

Hi Johnny,

We will need to create a taxonomy view to display the taxonomy meta information.

You need to do a view in a view setup where you create a taxonomy view and then add a filter for the taxonomy term.

Set it to display for the current post. See screenshot

Please let me know if this helps.
Thanks,
Shane

#426754

Hello Shane,

After some hacking and testing I figured out the setup and got this to work. Now it's just styling needed left. Closing this case now. 🙂

Thanks.

The forum ‘Types Community Support’ is closed to new topics and replies.