forked from roots/sage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate-faq.php
44 lines (40 loc) · 1.22 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
<?php
/*
Template Name: FAQ Template
*/
include_once locate_template('/lib/advance-edit-toolkit.php');
$header = get_post_meta( $post->ID, 'advedit_faq_root_title', true )?:"";
$body = get_post_meta( $post->ID, 'advedit_faq_root_body', true )?:"";
$titles = get_post_meta( $post->ID, 'advedit_faq_question', true )?:array();
$texts = get_post_meta( $post->ID, 'advedit_faq_answer', true )?:array();
$panelmode = get_panel_mode();
function get_body_css_class($id) {
switch ($id) {
case 0:
return "col-xs-12";
case 1:
return "col-md-8 col-xs-12" . " col-md-push-4";
case 2:
return "col-sm-8 col-xs-12" . " col-sm-push-4";
}
}
?>
<div class="container page">
<div class="row">
<div class="col-md-8 col-xs-12 col-md-push-4">
<div class="faq">
<?php
for ($i = 0; $i < count($titles); $i++) {
?>
<div class="accordion">
<div class="title"><?php echo $titles[$i]?:"text"; ?></div>
<div class="body"><?php echo html_entity_decode($texts[$i])?:""; ?></div>
</div>
<?php
}
?>
</div>
</div>
<?php $panelmode = generate_panel("col-sm-pull-8 visible-md visible-lg"); ?>
</div>
</div>