Home › Forums › ACF PRO › Query relationship field inside WP_Query loop › Reply To: Query relationship field inside WP_Query loop
a relationship field can be set up to return post objects. The field should be returning a list of posts and you can access the values of those posts without have_posts. Each post in the returned array will have, in your case, $p->ID, which is the ID of the post. Using that ID you can get the value of an ACF field or other information about that post without the need of a have_posts() 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.