Home › Forums › General Issues › Query cpt then echo if relationship exists › Reply To: Query cpt then echo if relationship exists
Thanks aregmk – have added set_postdata($addon) after the foreach but not getting the right result, i.e. getting same result if item is in the relationship or not.
Adding the post_id onto the add_on_suites gives me the opposite result. Note: add_on_suites is not a field of the addons cpt – it is a field on the current post (i.e. the relationship exists on this post to the addons cpt).
Wondering if it could be the $included query <?php if( $included ): ?>
is just checking if ‘anything at all’ is included and if so, then giving me a tick?
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.