Home › Forums › Add-ons › Repeater Field › Repeater field value not loading on Homepage
Hello @hube2,
I’m new to using ACF. I’m having a problem with try to load my content on my homepage. I’m trying to use Repeater field, Text field, Textarea field and Image field to make a services section on the homepage.
I’m going to display the code that I have inside my content-services.php. I’m not getting any error message on in my browser.
<section class="services cf">
<div class="wrapper">
<div class="service">
<div class="box-service">
<?php
if( have_rows('services_sections') ):
// loop through the rows of data
while ( have_rows('services_sections') ) : the_row(); ?>
<div class="pull-left">
<?php $image = get_sub_field('services_icon'); if( !empty($image) ): ?>
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
<?php endif; ?>
</div>
<div class="right-word">
<h3><?php the_sub_field('service_title') ?></h3>
<p><?php the_sub_field('services_description')?></p>
</div>
</div>
<div class="line"></div>
<div class="box-service">
<div class="pull-left">
<?php $image = get_sub_field('services_icon'); if( !empty($image) ): ?>
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
<?php endif; ?>
</div>
<div class="right-word">
<h3><?php the_sub_field('service_title') ?></h3>
<p><?php the_sub_field('services_description')?></p>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
</div>
</section>
https://gyazo.com/ca0fefd90222067920e662940bb3ddff
I don’t see anything wrong with the code. There are two things that I can think of that would cause this. Either the field group is not being edited on the home page or your template file is not being called. What are the location rules for the page?
The topic ‘Repeater field value not loading on Homepage’ is closed to new replies.
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.