Last active
August 29, 2015 14:00
-
-
Save erezLieberman/11368092 to your computer and use it in GitHub Desktop.
FAQ tmplt with bootstrap3 and ACF
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"> | |
| <?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