Support

Account

Home Forums Add-ons Repeater Field Help with repeater on home page

Unread

Help with repeater on home page

  • Hello I am new to using ACF and I am trying to put fields into my home page I have set up the font end and I can get it to the edit page however the template used is the default template which when I check is made up of page.php
    template parts/ slider.php
    template parts/ home widgets.php
    template parts/ banner.php
    template parts/ page.php
    Which of these components should I add code to I have tried but without success to use the following code
    <?php

    // check if the repeater field has rows of data
    if( have_rows(‘features’) ):

    // loop through the rows of data
    while ( have_rows(‘features’) ) : the_row();
    // display a sub field value
    the_sub_field(‘feature’);
    the_sub_field(‘hero’);
    the_sub_field(‘content’);
    endwhile;
    else :
    // no rows found
    endif;
    ?>

Viewing 1 post (of 1 total)

The topic ‘Help with repeater on home page’ is closed to new replies.