sorry for the long delay, you’re reply got burried. Anyway, the post id should already be set up by this
$post_object = get_field('select_sidebar'); if( $post_object ): // override $post $post = $post_object; // this set up the post data including the ID setup_postdata( $post ); ?> <div class="col-xs-12 col-sm-4 sidebar"> <?php if( have_rows('sidebar_blocks') ): ?>
If this is not working then I’m not sure what the problem is. It could be that the global $post is not defined. Try defining it by adding
$post = $post_object;
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!
© 2022 Advanced Custom Fields.