Forked from omurphy27/bootstrap collapse accordion with ACF repeater loop.php
Last active
August 29, 2015 14:21
-
-
Save myasseen/0f8c93a3820722e77f06 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true"> | |
<?php $i=1; while(has_sub_field('sections')) : ?> | |
<div class="panel panel-default"> | |
<div class="panel-heading" role="tab" id="heading-<?php echo $i; ?>"> | |
<h2 class="panel-title"> | |
<a data-toggle="collapse" data-parent="#accordion" href="#collapse-<?php echo $i; ?>" aria-expanded="true" aria-controls="collapseOne"> | |
<?php the_sub_field('heading'); ?> | |
</a> | |
</h2> | |
</div> | |
<div id="collapse-<?php echo $i; ?>" class="panel-collapse collapse <?php if ($i==1) { echo 'in'; } ?>" role="tabpanel" aria-labelledby="heading-<?php echo $i; ?>"> | |
<div class="panel-body"> | |
<?php the_sub_field('text'); ?> | |
</div> | |
</div> | |
</div> | |
<?php $i++; endwhile; ?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment