Skip to content

Instantly share code, notes, and snippets.

@wpflames
Created April 11, 2022 10:26
Show Gist options
  • Select an option

  • Save wpflames/30d07d04621c7d1da8d0306291130ff7 to your computer and use it in GitHub Desktop.

Select an option

Save wpflames/30d07d04621c7d1da8d0306291130ff7 to your computer and use it in GitHub Desktop.
Accordion with acf repeater php template file
<div class="accordion-wrapper">
<?php if(get_field('repeater_root')): ?>
<?php while(has_sub_field('repeater_root')): ?>
<h2 class="headline accordion-title"><?php the_sub_field('repeater_heading'); ?></h2>
<div class="accordion-panel">
<?php if(get_sub_field('repeater_item')): ?>
<?php while(has_sub_field('repeater_item')): ?>
<div class="row download accordion-content">
<div class="col-md-8">
<a class="prezi-title" href="<?php the_sub_field('file'); ?> <?php the_sub_field('pdf'); ?>"><?php the_sub_field('title'); ?></a>
</div>
<div class="col-md-4">
<a href="<?php the_sub_field('file'); ?>" class="download"><i class="far fa-file-archive"></i><span>Download</span></a>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment