47 lines
1.5 KiB
PHP
47 lines
1.5 KiB
PHP
<?php
|
|
/**
|
|
* Секция «FAQ» страницы класса начальной школы.
|
|
* Вкладка «❓ FAQ»: аккордеон на <details>. Микроразметка FAQPage — в page-class.php.
|
|
*
|
|
* @package Dekart
|
|
*/
|
|
|
|
if (! defined('ABSPATH')) {
|
|
exit;
|
|
}
|
|
|
|
$post_id = (int) get_the_ID();
|
|
|
|
$faq_title = crb_get_post_meta($post_id, 'class_faq_title', 'Часто задаваемые вопросы');
|
|
$faq_items = crb_get_post_meta($post_id, 'class_faq_items');
|
|
|
|
if (empty($faq_items) || ! is_array($faq_items)) {
|
|
return;
|
|
}
|
|
?>
|
|
|
|
<section class="class-faq section-bg" data-bg="class-faq" id="class-faq" aria-labelledby="class-faq-title">
|
|
<div class="container">
|
|
|
|
<div class="section-header--left">
|
|
<h2 id="class-faq-title" class="bento-h2"><?php echo esc_html($faq_title); ?></h2>
|
|
</div>
|
|
|
|
<div class="class-faq__list">
|
|
<?php foreach ($faq_items as $item) :
|
|
$q = isset($item['faq_question']) ? trim($item['faq_question']) : '';
|
|
$a = isset($item['faq_answer']) ? trim($item['faq_answer']) : '';
|
|
if ('' === $q || '' === $a) {
|
|
continue;
|
|
}
|
|
?>
|
|
<details class="class-faq__item">
|
|
<summary class="class-faq__question"><?php echo esc_html($q); ?></summary>
|
|
<div class="class-faq__answer"><?php echo esc_html($a); ?></div>
|
|
</details>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
|
|
</div>
|
|
</section>
|