Home › Forums › Front-end Issues › List terms which also have a certain relationship › Reply To: List terms which also have a certain relationship
Thanks James,
I’m not sure if I’m not understanding your code or if I didn’t explain my problem properly. I believe I am already able to output what you have suggested with a query like this(?):
$args = array (
'post_type' => 'stockists',
'post__in' => $participating_ids,
'meta_key' => 'stockist_address_0_stockist_country',
);
This gives me a list of stockists, as does your code — as far as I can tell.
I need a list of countries but only if they are on posts that have the relationship. Then also the country should only appear once. I am trying to use them as headings for the stockists in the promotion e.i.:
Participating Stockists
=======================
England
——-
– Stockist
Scotland
——–
– Stockist
Wales
—–
– Stockist
I was just asking about the first part of getting the countries to list out but I would then make sure the nested loop only outputted stockists in the country AND the current promotion relationship.
I’m no programmer so forgive me if I’ve missed if your solution is actually doing that.
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.