Home › Forums › General Issues › Taxonomy grabbing fields from posts, but in wrong order › Reply To: Taxonomy grabbing fields from posts, but in wrong order
Ok, so I didn’t figure out how to get the taxonomy to pull in the fields from the latest post but…
I did figure out how to show the fields from the actual taxonomy (‘categoria’), rather than one of its posts:
if (is_tax()) {
while( has_sub_field('imagens', 'categoria_'.$wp_query->queried_object->term_id) ):
//stuff
endwhile;
} else {
while( has_sub_field('imagens') ):
//stuff
endwhile;
}
Would still prefer for it to automatically grab from the latest post if anyone can offer an answer?
Thanks!
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.