Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<main id="Main">
<div class="page-wrapper">
<div class="container">
<div class="row">
<div id="menuBarleft" class="col-lg-3 col-sm-12">
<div id="navbarNav" class="nav nav-tabs">
<div id="v-pills-tab" class="nav flex-column nav-pills menu-left" role="tablist" aria-orientation="vertical">
<?php $group_values = rwmb_meta( 'faq_tab' );
$count = 0;
if ( ! empty( $group_values ) ) {
foreach ( $group_values as $group_value ) {
$count++;
$value = isset( $group_value['tab_name'] ) ? $group_value['tab_name'] : ''; ?>
<a id="v-pills-home-tab" class="<?php if($count ==1) echo 'active'; ?>" role="tab" href="#tab<?php echo $count; ?>" data-toggle="pill" aria-controls="tab<?php echo $count; ?>" aria-selected="true"><?php echo $value; ?> </a>
<?php }
} ?>
</div>
</div>
</div>
<div id="Content" class="col-lg-9 col-sm-12">
<div id="v-pills-tabContent" class="tab-content">
<?php $group_values = rwmb_meta( 'faq_tab' );
$count_c = 0;
if ( ! empty( $group_values ) ) {
foreach ( $group_values as $group_value ) {
$count_c++;
$value = isset( $group_value['tab_name'] ) ? $group_value['tab_name'] : '';
$group_childs = isset( $group_value['q_and_a'] ) ? $group_value['q_and_a'] : ''; ?>
<div id="tab<?php echo $count_c; ?>" class="tab-pane fade <?php if($count_c ==1) echo 'show active'; ?>" role="tabpanel" aria-labelledby="tab<?php echo $count_c; ?>-tab">
<?php
$count_q = 0;
foreach ( $group_childs as $group_child ) {
$count_q++;
$question = isset( $group_child['question'] ) ? $group_child['question'] : '';
$answer = isset( $group_child['answer'] ) ? $group_child['answer'] : ''; ?>
<div class="panel">
<h4 class="panel-title"><a class="" href="#question-trip-<?php echo $count_q; ?>" data-toggle="collapse" aria-expanded="true"><?php echo $question; ?></a></h4>
<div class="panel-content">
<div id="question-trip-<?php echo $count_q; ?>" class="question collapse show">
<?php echo $answer; ?></a>
</div>
</div>
</div>
<?php } ?>
</div>
<?php }
} ?>
</div>
</div>
</div>
</div>
</div>
</main>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.