Support

Account

Home Forums Add-ons Repeater Field Repeater field value not loading on Homepage

Helping

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> 
    
    

    This What I'm trying to Create with Repeater

    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?

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Repeater field value not loading on Homepage’ is closed to new replies.