Home › Forums › ACF PRO › Get the data from a custom ACF Block and print to another page › Reply To: Get the data from a custom ACF Block and print to another page
This is my code. 2276 is the block ID. When I make the changes on the block from the first page (homepage), then the changes are not passed to the second page (services). I wonder what I am doing wrong.
<?php
$block_ID=2276;
$services_header_title = get_field('services_header_title', $block_ID);
?>
<div class="col-lg-12">
<h2><?php echo $services_header_title; ?></h2>
</div>
<?php if( have_rows('services') ): ?>
<?php while( have_rows('services') ): the_row();
// Get sub field values.
$service_title = get_sub_field('service_title', $block_ID);
$service_content = get_sub_field('service_content', $block_ID);
?>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
<h3><?php echo $service_title; ?></h3>
<p><?php echo $service_content; ?></p>
</div>
<?php endwhile; ?>
<?php 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!
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.