Home › Forums › ACF PRO › Getting ACF field from a taxonomy in a page with WP_query › Reply To: Getting ACF field from a taxonomy in a page with WP_query
That really does not help?
I see a query for posts. This has a taxonomy query. This includes 'fields' => $logo,
. There is not “fields” argument for a taxonomy query. There is a “field” argument, but that argument does not take the value you are attempting to use. So I can’t really tell what posts you are trying to get here?
From what I understand you are also trying to get an image file from the term here $logo = get_field('logo_marque');
Getting a value from a term requires that you know the term, or at least the term ID and supply this when getting the ACF field. https://www.advancedcustomfields.com/resources/adding-fields-taxonomy-term/
I a guessing that you want to show posts in a term and show the term images for the post. In this case your taxonomy query requires the term ID, name, or slug to search posts by. For example
'tax_query => array(
array(
'taxonomy' => 'marques-produits',
'field' => 'term_id',
'terms' => $term_id
)
)
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.