Support

Account

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; ?>