Home › Forums › Front-end Issues › Displaying Fields from Post Category or Subcategory › Reply To: Displaying Fields from Post Category or Subcategory
You’ll need to set the second function parameter to ‘category-slug_2’ where ‘2’ is the term ID. So for example:
the_field('test_field', 'beer_' . $term_id);
would output the “test_field” value for the term with ID $term_id in the “beer” taxonomy.
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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.