I understand getting page A data and the $post_id parameter. I think now I am confused on how page B will actually display that data on the page. All of my other custom field content uses the Location and Rules to display. So what PHP would I add to my template file that says:
on page B post the following:
<?php if( have_rows('active_studies', 14) ): ?> <?php while ( have_rows('active_studies') ) : the_row(); ?> <h1><?php the_sub_field('title'); ?></h1> <h2><?php the_sub_field('investigator_name'); ?></h2> <h2><i><?php the_sub_field('organization(s)'); ?></i></h2> <p><?php the_sub_field('summary'); ?></p> <h3><?php the_sub_field('related_content_title'); ?></h3> <p style="color: #666666;"><?php the_sub_field('related_content'); ?></p> <?php endwhile; else : // no rows found endif; ?>
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!
The ACF site is currently experiencing some issues.— Advanced Custom Fields (@wp_acf) September 29, 2022
We apologize for the inconvenience and we are working hard to get it back up and running as soon as possible.
© 2022 Advanced Custom Fields.