fix(faq): pindahkan posisi FAQ ke bawah berita dan set semua item tertutup secara default

This commit is contained in:
Mas Budi Kusuma
2026-09-15 23:33:56 +07:00
parent 7c2a9131de
commit 2f53ae6e8d
+45 -49
View File
@@ -260,56 +260,9 @@
</section> </section>
<?php endif; ?> <?php endif; ?>
<!-- 9. SEKSI FAQ / PERTANYAAN UMUM (ACCORDION NATIVE) --> <!-- 9. LATEST NEWS (SEKARANG BERADA DI ATAS FAQ) -->
<?php
if ( get_option('edukarsa_tampil_faq', 1) == 1 ) :
$query_faq = new WP_Query( array( 'post_type' => 'faq', 'posts_per_page' => -1, 'order' => 'ASC' ) );
if ( $query_faq->have_posts() ) :
$faq_sub = get_option( 'edukarsa_faq_subtitle', 'FAQ' );
$faq_title = get_option( 'edukarsa_faq_title', 'Pertanyaan Umum' );
?>
<section class="edukarsa-section edukarsa-faq-section">
<div class="container">
<div class="section-header text-center" style="margin-bottom: 40px;">
<?php if ( ! empty( $faq_sub ) ) : ?><span class="badge-title"><?php echo esc_html( $faq_sub ); ?></span><?php endif; ?>
<h2 class="section-title"><?php echo esc_html( $faq_title ); ?></h2>
<hr class="title-underline">
</div>
<div class="faq-accordion-container">
<?php
$item_index = 0;
while ( $query_faq->have_posts() ) : $query_faq->the_post();
// Buka pertanyaan pertama secara default untuk mengundang interaksi
$active_class = ( $item_index === 0 ) ? ' active' : '';
?>
<div class="faq-item<?php echo $active_class; ?>">
<button type="button" class="faq-header">
<span class="faq-title"><?php the_title(); ?></span>
<span class="faq-icon">+</span>
</button>
<div class="faq-body">
<div class="faq-body-content">
<?php the_content(); ?>
</div>
</div>
</div>
<?php
$item_index++;
endwhile;
wp_reset_postdata();
?>
</div>
</div>
</section>
<?php
endif;
endif;
?>
<!-- 10. LATEST NEWS -->
<?php if ( get_option('edukarsa_tampil_news', 1) == 1 ) : ?> <?php if ( get_option('edukarsa_tampil_news', 1) == 1 ) : ?>
<section class="edukarsa-section edukarsa-latest-news" style="padding-top: 40px;"> <section class="edukarsa-section edukarsa-latest-news" style="padding-top: 50px; padding-bottom: 60px;">
<div class="container"> <div class="container">
<div class="section-header text-center"> <div class="section-header text-center">
<span class="badge-title">INFORMASI TERKINI</span> <span class="badge-title">INFORMASI TERKINI</span>
@@ -346,6 +299,49 @@
</section> </section>
<?php endif; ?> <?php endif; ?>
<!-- 10. SEKSI FAQ / PERTANYAAN UMUM (DI BAWAH BERITA & DEFAULT MINIMIZED) -->
<?php
if ( get_option('edukarsa_tampil_faq', 1) == 1 ) :
$query_faq = new WP_Query( array( 'post_type' => 'faq', 'posts_per_page' => -1, 'order' => 'ASC' ) );
if ( $query_faq->have_posts() ) :
$faq_sub = get_option( 'edukarsa_faq_subtitle', 'FAQ' );
$faq_title = get_option( 'edukarsa_faq_title', 'Pertanyaan Umum' );
?>
<section class="edukarsa-section edukarsa-faq-section" style="padding: 60px 0 80px; background-color: #f8fafc;">
<div class="container">
<div class="section-header text-center" style="margin-bottom: 40px;">
<?php if ( ! empty( $faq_sub ) ) : ?><span class="badge-title"><?php echo esc_html( $faq_sub ); ?></span><?php endif; ?>
<h2 class="section-title"><?php echo esc_html( $faq_title ); ?></h2>
<hr class="title-underline">
</div>
<div class="faq-accordion-container">
<?php
while ( $query_faq->have_posts() ) : $query_faq->the_post();
?>
<div class="faq-item">
<button type="button" class="faq-header">
<span class="faq-title"><?php the_title(); ?></span>
<span class="faq-icon">+</span>
</button>
<div class="faq-body">
<div class="faq-body-content">
<?php the_content(); ?>
</div>
</div>
</div>
<?php
endwhile;
wp_reset_postdata();
?>
</div>
</div>
</section>
<?php
endif;
endif;
?>
</main> </main>
<script> <script>