-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive-faqs.php
55 lines (47 loc) · 1.49 KB
/
archive-faqs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php get_header(); ?>
<!-- background shapes -->
<div class="top-left-shapes">
<div class="big-rec-wrapper all-shapes-wrapper">
<div class="big-rec"></div>
<div class="sm-rec"></div>
<div class="background-cover"></div>
</div>
</div>
<h1 class="faq-header"> FAQ </h1>
<div class="faq-container">
<?php
$terms = get_terms('faq_category');
foreach($terms as $term) : ?>
<div class="faq-category">
<h3><?php echo $term->name;?></h3>
<hr>
</div>
<div class="faq-list">
<?php
$faqs = new WP_Query(array(
'post_type' => 'faqs',
'order' => 'DESC',
'tax_query' => array(
array(
'taxonomy' => 'faq_category',
'field' => 'name',
'terms' => $term->name
),
),
));
while($faqs->have_posts() ) :
$faqs->the_post(); ?>
<div class="faq-single">
<div class="faq-single-wrap">
<p><?php the_title(); ?></p><i class="fas fa-plus toggle-answer"></i>
<i class="fas fa-minus toggle-answer"></i>
</div>
<hr>
<div class="faq-answer"><?php the_content(); ?></div>
</div>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
</div>
<?php endforeach; ?>
</div>
<?php get_footer(); ?>