Home › Forums › General Issues › Share Field Values Across Pages › Reply To: Share Field Values Across Pages
Kevin,
Thanks for your response. I’m not sure I fully understand the above, but my design and needs have changed, and I’m getting closer to understanding what I need… and maybe you can help again?
This code will be on a Band Page, calling to a Competition Page. Each have repeaters… band repeats competition list, competition repeats band and scores. I want to call a specific band’s scores from the competition page. I’m not sure how to specify the repeater row.
<?php
$post_object = get_sub_field(‘competition’);
if( $post_object): $post = $post_object;
setup_postdata( $post ); ?>
<?php
if( have_rows(‘competition_schedule’) ):
while ( have_rows(‘competition_schedule’) ) : the_row();
the_sub_field(‘band_score’);
endwhile;
else :
// no rows found
endif; ?></p>
<?php wp_reset_postdata(); ?>
<?php endif; ?>
But right now, each band is pulling the same score.
https://www.michiganmarching.com/bund/new-bund
https://www.michiganmarching.com/bund/three-bund
While I haven’t touched a template yet for the competitions in this regard, “State fight” does have both New Bund and Three Bund as in there, within the repeater, with different scores.
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!
ACF PRO’s Flexible Content field allows you to create smaller pieces of UI and compose them into whole flexible patterns. In our latest article, we show how to use it to create swappable site sections and integrate it all in a theme.https://t.co/ZRocH8oJSp
— Advanced Custom Fields (@wp_acf) January 24, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.