Home › Forums › General Issues › my custom field does not appear ? › Reply To: my custom field does not appear ?
Hello,
The problem you have here is that get_field needs to have an additional parameter in it to specifically say which taxonomy term it is supposed to look at for the content.
https://www.advancedcustomfields.com/resources/get-values-from-a-taxonomy-term/
In this instance, you’ll be looking to output the field on the taxonomy page, which would be the following code:
// vars
$queried_object = get_queried_object();
$taxonomy = $queried_object->taxonomy;
$term_id = $queried_object->term_id;
// load thumbnail for this taxonomy term (term string)
$service_editor = get_field('service_editor', $taxonomy . '_' . $term_id);
echo $service_editor;
Edit: Sorry Jonathan, I didn’t refresh the page before I posted and didn’t see your reply. Hope either of our responses help.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
ACF wouldn’t be so widely used in WordPress if it didn’t have some pretty amazing capabilities. In this article, we look at a few of the features we’ll discuss during “7 things you didn’t know you could do with ACF” at #WPEDecode later this month. https://t.co/5lnsTxp81j pic.twitter.com/Yf0ThPG1QG
— Advanced Custom Fields (@wp_acf) March 16, 2023
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.