Home › Forums › Add-ons › Repeater Field › Get subfields from a repeater on one page to appear on another page › Reply To: Get subfields from a repeater on one page to appear on another page
When getting fields from another post you need to supply the post ID of the post you want to get them from. In the case of a repeater, this only needs to be done for the top level field
if (have_rows('repeater_field', $post_id)) {
while (have_rows('repeater_field', $post_id)) {
the_row();
get_sub_field('sub_field_name');
}
}
More information here https://www.advancedcustomfields.com/resources/how-to-get-values-from-another-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.