Skip to content

Instantly share code, notes, and snippets.

@erezLieberman
Last active August 29, 2015 14:00
Show Gist options
  • Select an option

  • Save erezLieberman/11368092 to your computer and use it in GitHub Desktop.

Select an option

Save erezLieberman/11368092 to your computer and use it in GitHub Desktop.
FAQ tmplt with bootstrap3 and ACF
<div class="panel-group" id="accordion">
<?php
$counter = 1;
// check if the repeater field has rows of data
if( have_rows('faqs') ):
// loop through the rows of data
while ( have_rows('faqs') ) : the_row(); ?>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse<?php echo $counter; ?>">
<?php the_sub_field('qustn');?>
</a>
</h4>
</div>
<div id="collapse<?php echo $counter; ?>" class="panel-collapse collapse">
<div class="panel-body">
<?php the_sub_field('ansr'); ?>
</div>
/div>
</div><!-- end panel -->
<?php
$counter ++;
endwhile;
else :
// no rows found
endif;
?>
</div><!-- end panel-group -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment