How to display a Custom Field for a Custom Taxonomy?
-
Hi there. Firstly, thank you for this plugin, it is working wonders. Combining ACF and ACF Views has unlocked so much pontential and I’ve very excited to keep working with this.
I have reached a stump, and I feel like it’s a simple solution, I just can’t figure out what exact words I need to put in between the {{__}} on some custom templates.
I am working on this page: https://burtonconstableholidaypark.co.uk/live-sports/its-derby-day/
I want to display a small logo with the Team Names; “Hull FC, Hull KR” in the blue section of this page.
This is an ACF Views item, which is assigned the “Teams” taxonomy from a “sports” field group.
This is working great and the linked term title loads into my template nicely out of the box with ACF Views. But I want icons too alongside the title.
Previously in another ACF View item, I created some custom esleif statements to produce an img and src based on the term value. However, that means adding the if statements and image URLs to the Custom Template every time I add a new term.
I want to be able to add new terms on the go without updating the template. So, I have created a custom field group with one custom image field in it for “team_logo” and assigned that to the “teams” taxonomy. Each term in the “teams” taxonomy now has an image.
However, back to my ACF Views item template, I cannot figure out how to customise the template code to get and display the “team_logo” field from the taxonomy term.
My understanding is, that the ACF Views template gets the term value from the taxonomy, and displays the term title.
I messed with the template code and noticed I could change “title” to “value”, which returns the URL. However, if I change this to anything else, such as “team_logo”, I get an error message on the front end suggesting that the options are limited to title, value, etc.
I’m not sure what setup is required here.
As the custom image field is assigned to a term, within a taxonomy.
When an ACF View item is assigned a field group, with that taxonomy as a field, can it access the custom image field?
If so, how? Is there an alternative setup that would make it accessible?
Does that make sense? Thanks for any advice.The page I need help with: [log in to see the link]
- The topic ‘How to display a Custom Field for a Custom Taxonomy?’ is closed to new replies.