Home › Forums › ACF PRO › ACF Relationship Block Issue › Reply To: ACF Relationship Block Issue
If you configure the Post Object
field to return a post object instead of the post ids, it will deliver an array of post objects ready to use. No need to call global $post
, setup_postdata( $post )
, or wp_reset_postdata()
. All of that seems to just unnecessarily confuse the page that is loading the block. In order to retrieve the permalink, the title, the featured image etc. of the posts assigned to the block, just use $post->ID
within the foreach ( $posts as $post )
.
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.