-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
template-faq.php
117 lines (104 loc) · 2.55 KB
/
template-faq.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
/* Template name: FAQ Page */
/**
* Frequently Asked Questions Template
*
* The template used for the Frequently Asked Questions page.
*
* @link Figma Doc https://www.figma.com/file/GFL1IJOfjKqRxBy1vYDBcc/Mockups?node-id=1203%3A594
*/
get_header();
?>
<?php
get_header();
the_post();
?>
<main class="main-content">
<header class="page-header">
<div class="container">
<div class="columns is-centered">
<div class="column is-12">
<?php get_template_part( 'inc/partials/entry/page', 'header' ); ?>
</div>
</div>
</div>
</header>
<div class="container">
<div class="columns is-centered is-variable is-8">
<div class="column is-4">
<aside class="sidebar faq-sidebar padding-top-xl padding-bottom-xl">
<?php
if ( have_rows( 'faq_group' ) ) :
while ( have_rows( 'faq_group' ) ) :
the_row();
$faqs_title = get_sub_field( 'title' );
?>
<section class="margin-bottom-bigger">
<h5 class="margin-bottom-normal">
<?php echo $faqs_title; ?>
</h5>
<?php
if ( have_rows( 'questions' ) ) :
while ( have_rows( 'questions' ) ) :
the_row();
// Get sub value.
$question = get_sub_field( 'question' );
$answer = get_sub_field( 'answer' )
?>
<a class="is-block margin-bottom-normal" href="#<?php echo str_slug( $question ); ?>">
<?php echo $question; ?>
</a>
<?php
endwhile;
endif;
?>
</section>
<?php
endwhile;
endif;
?>
</aside>
</div>
<div class="column is-8">
<section class="entry-page-content padding-top-xl faqs">
<div>
<?php
if ( have_rows( 'faq_group' ) ) :
while ( have_rows( 'faq_group' ) ) :
the_row();
$faqs_title = get_sub_field( 'title' );
?>
<section class="faq-group margin-bottom-xl body-big">
<h2 class="margin-bottom-bigger">
<?php echo $faqs_title; ?>
</h2>
<?php
if ( have_rows( 'questions' ) ) :
while ( have_rows( 'questions' ) ) :
the_row();
// Get sub value.
$question = get_sub_field( 'question' );
$answer = get_sub_field( 'answer' )
?>
<h3 class="margin-bottom-big margin-top-large faq-title subtitle" id="<?php echo str_slug( $question ); ?>">
<a href="#<?php echo str_slug( $question ); ?>">
<?php echo $question; ?>
</a>
</h3>
<?php echo $answer; ?>
<?php
endwhile;
endif;
?>
</section>
<?php
endwhile;
endif;
?>
</div>
</section>
</div>
</div>
</div>
</main>
<?php get_footer(); ?>