Skip Navigation

[Resolved] Use of taxonomy termfields in Views

This support ticket is created 8 years 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.

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 5 replies, has 2 voices.

Last updated by Shane 8 years ago.

Assisted by: Shane.

Author
Posts
#387526

I am trying to:

set the color of a headline of a CPT based on a term field of a taxonomy used by the CPT

I have a custom post type "competences"
I have a custom taxonomy "competences_tag" with a term field "competence_color"

I created a view to show all competences and I want to set the color of the headline of each competence to the "competence_color" of the "competence_tag" selected at the competence.

#387790

Shane
Supporter

Languages: English (English )

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

Hi Rainer,

Thank you for contacting our support forum.

Could you let me know what type of information the competence_color holds ? Does it contain the hexcode of your color ?

Also I would like to see how your view loop is setup. This would allow me to get an understanding of how we can go forward on this.

Thanks,
Shane

#389580
competences taxonomy.png
desired result.png
view (not using the competence taxonomy color yet).png

Please find some screenshots explaining the situation.

We used a separate taxonomy now for the colors.
The intended solution, however, is to use the color set in the taxonomy termfield of the competences taxonomy.

#389676

Shane
Supporter

Languages: English (English )

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

Hi Rainer,

Thank you for the additional information.

It seems from your trying to use the shortcode to do the css styling.

Unfortunately since version 4.3 of wordpress you are no longer able to use shortcodes in style attribute. See the link below for further details.

https://make.wordpress.org/core/2015/07/23/changes-to-the-shortcode-api/

Please let me know if this helps.
Thanks,
Shane

#389890

Hi Shane!

This is not the problem.

The problem is how to access a term field in a taxonomy when I don't use a taxonomy view or taxonomy archive.

we have a view of the CPT "competences".
This CPT uses a taxonomy "competences_tag"
We want to access a term field of this taxonomy.

rgds
Rainer

#390288

Shane
Supporter

Languages: English (English )

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

Hi Rainer,

The problem here is that since you are using a view to list out CPT then you wont have access to the term fields.

Term fields can only be displayed in a taxonomy view. So this is a limitation that we have here.

So its not possible to have term fields in a CPT view .

Thanks,
Shane

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.