Home › Forums › ACF PRO › Shortcode for fields attached to taxonomies › Reply To: Shortcode for fields attached to taxonomies
Hi Steven,
The shortcode only returns simple text-based values, so if the agent_picture
returns an array of image info, then the shortcode will not be ideal for your use case. However, you can probably use it to display an agent’s name, email, and phone, assuming that all those values are stored in text, email, and tel type fields.
Anyway, I think you are getting the shortcode confused with code that would happen in a code loop that goes through the homes. The logic would look something like this for your use case:
foreach home CPT as Home
Display Home info
Get all Agents assigned to Home
foreach Agents as Agent
Display Agent info (this is where you can use the shortcode)
endforeach loop
endforeach loop
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.