feat: integrasi modul FAQ accordion native dan input jam kerja multi-baris

This commit is contained in:
Mas Budi Kusuma
2026-09-15 23:27:30 +07:00
parent 03d6abd8ba
commit 7c2a9131de
5 changed files with 244 additions and 583 deletions
+62 -6
View File
@@ -80,7 +80,7 @@
</section>
<?php endif; ?>
<!-- 4. MILESTONES (LABEL & HEADINGS DINAMIS) -->
<!-- 4. MILESTONES -->
<?php
if ( get_option('edukarsa_tampil_milestone', 1) == 1 ) :
$query_milestone = new WP_Query( array( 'post_type' => 'milestone', 'posts_per_page' => 4 ) );
@@ -122,7 +122,7 @@
endif;
?>
<!-- 5. PROGRAM UNGGULAN (LABEL & HEADINGS DINAMIS) -->
<!-- 5. PROGRAM UNGGULAN -->
<?php
if ( get_option('edukarsa_tampil_program', 1) == 1 ) :
$prog_sub = get_option( 'edukarsa_program_subtitle', 'AKADEMIK & KARAKTER' );
@@ -199,7 +199,7 @@
</section>
<?php endif; ?>
<!-- 7. KEUNGGULAN DINAMIS (LABEL & HEADINGS DINAMIS) -->
<!-- 7. KEUNGGULAN DINAMIS -->
<?php
if ( get_option('edukarsa_tampil_keunggulan', 1) == 1 ) :
$k_sub = get_option( 'edukarsa_keunggulan_subtitle', 'WHY CHOOSE US' );
@@ -241,7 +241,7 @@
</div>
</div>
<!-- 8. CTA SECTION (FLOATING CARD DESIGN) -->
<!-- 8. CTA SECTION (FLOATING CARD) -->
<?php if ( get_option('edukarsa_tampil_cta', 1) == 1 ) : ?>
<section class="edukarsa-cta-floating-section">
<div class="container">
@@ -260,9 +260,56 @@
</section>
<?php endif; ?>
<!-- 9. LATEST NEWS -->
<!-- 9. SEKSI FAQ / PERTANYAAN UMUM (ACCORDION NATIVE) -->
<?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 ) : ?>
<section class="edukarsa-section edukarsa-latest-news" style="padding-top: 50px;">
<section class="edukarsa-section edukarsa-latest-news" style="padding-top: 40px;">
<div class="container">
<div class="section-header text-center">
<span class="badge-title">INFORMASI TERKINI</span>
@@ -303,6 +350,7 @@
<script>
document.addEventListener("DOMContentLoaded", function() {
// 1. Slider Auto Scroll
const slider = document.getElementById('hero-slider-wrapper');
if (slider && slider.children.length > 1) {
setInterval(function() {
@@ -313,6 +361,14 @@ document.addEventListener("DOMContentLoaded", function() {
}
}, 4000);
}
// 2. FAQ Accordion Toggle Interaction
document.querySelectorAll('.faq-header').forEach(function(header) {
header.addEventListener('click', function() {
const item = this.parentElement;
item.classList.toggle('active');
});
});
});
</script>