faq posttype
Tue Mar 05 2024 14:44:42 GMT+0000 (Coordinated Universal Time)
Saved by
@BilalRaza12
<div class="col-md-6">
<div class="accordion" id="accordionLeft">
<?php $count = 0; ?>
<?php while ($faq_posts->have_posts() && $count < 4):
$faq_posts->the_post(); ?>
<div class="accordion-item">
<h2 class="accordion-header" id="heading-<?php the_ID(); ?>">
<button class="accordion-button<?php echo ($count === 0) ? '' : ' collapsed'; ?>" type="button" data-bs-toggle="collapse"
data-bs-target="#collapse-<?php the_ID(); ?>" aria-expanded="<?php echo ($count === 0) ? 'true' : 'false'; ?>"
aria-controls="collapse-<?php the_ID(); ?>">
<?php the_title(); ?>
</button>
</h2>
<div id="collapse-<?php the_ID(); ?>" class="accordion-collapse collapse<?php if ($count === 0) echo ' show'; ?>"
aria-labelledby="heading-<?php the_ID(); ?>" data-bs-parent="#accordionRight">
<div class="accordion-body">
<?php the_content(); ?>
</div>
</div>
</div>
<?php $count++; ?>
<?php endwhile; ?>
</div>
</div>
content_copyCOPY
Comments