Home › Forums › General Issues › ACF fields with Zurb's data interchange › Reply To: ACF fields with Zurb's data interchange
Hi Elliot,
Thanks for getting back to me.
The template is a custom include file. I have a custom template for my contact page and within that I’m calling the contact_details_small.php or contact_details_default.php that has the acf fields in. When the fields are placed directly in the contact template they work fine, but when I move them to the the include files I get nothing.
I’m beginning to think maybe I’m just using the acf code wrong as the include files are definitely being read because plain html is being output. I simplified the code above so as to make it easier to understand. The full code in the include file is below:
<?php
require($_SERVER['DOCUMENT_ROOT'].'/pwp/wp-load.php');
?>
<div class="phone_email_holder">
<p>LARGE TEMPLATE</p>
<?php if( have_rows('phone_numbers') ): ?>
<?php while( have_rows('phone_numbers') ): the_row(); ?>
<div class="contact_field_wrapper row">
<div class="phone_email_label info_label"><?php echo get_sub_field('number_label') ?>:</div>
<div class="phone_email_value"><?php echo get_sub_field('tel_number') ?></div>
</div>
<?php endwhile; ?>
<?php endif; ?>
<?php if( have_rows('email_addresses') ): ?>
<?php while( have_rows('email_addresses') ): the_row(); ?>
<div class="contact_field_wrapper row">
<div class="phone_email_label info_label"><?php echo get_sub_field('email_label') ?>:</div>
<div class="phone_email_value"><a class="" href="mailto:<?php echo get_sub_field('email_address'); ?>"><?php echo get_sub_field('email_address') ?></a></div>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
The “LARGE TEMPLATE” bit is being output from the above code. Just not the rest. All I’m doing is removing links from telephone numbers for the desktop version of the site and adding them back in for mobile versions.
Thanks for looking into this.
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.