Home › Forums › Add-ons › Repeater Field › Make (Sub_Field) Link to Post? › Reply To: Make (Sub_Field) Link to Post?
Hey there, I’m having the same issue (or very similar). I setup the structure to have a repeater field with “Artists”, and then each artist is fetched from the post_object field (each artist is a Page in my case). I read the documentation for the post_object, but honestly can’t get any output (ok, I’m not a developer, I rely a lot on copy/paste, don’t judge me) 😀
I tried what the documentation says:
<?php if(get_field('album_artist')): ?> <?php while(has_sub_field('album_artist')):?> <?php $post_object = get_field('post_object'); if( $post_object ): // override $post $post = $post_object; setup_postdata( $post ); ?> <div> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <span>Post Object Custom Field: <?php the_field('artist_name'); ?></span> </div> <?php wp_reset_postdata(); // IMPORTANT - reset the $post object so the rest of the page works correctly ?> <?php endif; ?> <?php endwhile; ?> <?php endif; ?>
but I get no output 🙁
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!
Accordions are a great way to group related information while allowing users to interactively show and hide content. In this video, Damon Cook goes in-depth on how to create an accessible accordion block using ACF PRO’s Repeater field.https://t.co/RXT0g25akN— Advanced Custom Fields (@wp_acf) March 2, 2023
© 2023 Advanced Custom Fields.