php - I m trying to use repeater inside repeater field any body can help me -
i trying use repeater inside repeater field. please point me mistake?
<?php if(get_field('help_blocks')): ?> <?php while(has_sub_field('help_blocks')): ?> <div class="col-sm-4"> <div class="block"> <h5><?php the_sub_field('block_title'); ?></h5> <?php the_sub_field('block_paragraph'); ?> <?php if(get_field('block_list')): ?> <ul class="list-style"> <?php while(has_sub_field('block_list')): ?> <li><?php the_sub_field('list_item'); ?></li> <?php endwhile; ?> </ul> <?php endif; ?> <img src="<?php the_sub_field('block_image'); ?>" alt="" /> <div class="text-center"> <a class="btn btn-primary" href="<?php the_sub_field('block_button_link'); ?>"><?php the_sub_field('block_button'); ?></a> </div> </div> </div> <?php endwhile; ?> <?php endif; ?>
it looks you're there.
you have line:
<?php if(get_field('block_list')): ?>
it should be:
<?php if(get_sub_field('block_list')): ?>
your nested repeater sub field of repeater, need use get_sub_field.
Comments
Post a Comment