44 lines
1.3 KiB
PHP
44 lines
1.3 KiB
PHP
<?php
|
|
|
|
/**
|
|
* FAQ template.
|
|
*
|
|
* @package ThemeStarter
|
|
*/
|
|
|
|
?>
|
|
|
|
|
|
<ul class="px-4">
|
|
<?php
|
|
$args = array(
|
|
'post_type' => 'faqs',
|
|
'posts_per_page' => -1,
|
|
'orderby' => 'date',
|
|
'order' => 'ASC',
|
|
);
|
|
$query = new WP_Query($args);
|
|
if ($query->have_posts()) {
|
|
while ($query->have_posts()) {
|
|
$query->the_post(); ?>
|
|
<li class="accordion bg-stone-200 rounded-md mb-4">
|
|
<div class="flex px-2 py-4 justify-between relative">
|
|
<h3 class="font-bold text-lg pr-6"><?php the_title() ?></h3>
|
|
<button aria-label="Accordion Dropdown Toggle" class="accordion-toggle absolute inset-0">
|
|
<i class="fas fa-chevron-down items-center ml-auto rounded-md px-2.5 py-2" aria-hidden="true"></i>
|
|
<i class="fas fa-times items-center ml-auto rounded-md px-3 py-2" aria-hidden="true"></i>
|
|
</button>
|
|
</div>
|
|
<div class="accordion-content pb-8">
|
|
<div>
|
|
<p> <?= get_field("faq_answer"); ?></p>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
<?php }
|
|
wp_reset_postdata();
|
|
} else {
|
|
// No posts found
|
|
}
|
|
?>
|
|
</ul>
|