How to use acf (Advanced-Custom-Fields) repeater in wordpress

<ul>
     <?php if(get_field('email_repeater','options')): ?>
             <?php while(has_sub_field('email_repeater','options')): ?>
                    <li>
                           <p><?php the_sub_field('email_head','options'); ?></p>
                           <a href="mailto:<?php the_sub_field('email_id','options'); ?> ">
   <?php the_sub_field('email_id','options'); ?>  </a>
                      </li>

                 <?php endwhile; ?>                           
            <?php endif; ?>

     </ul>
Remove options from  ('email_repeater','options')) if you are using a page template , or the field is not coming from option page.

Comments

Popular posts from this blog

datatable with both top and bottom scroll bar.

How to set custom Post feature image as og:image ?