fix(layout): cegah jeda kosong seksi milestone dan seed sampel konten lengkap

This commit is contained in:
Mas Budi Kusuma
2026-09-15 22:16:05 +07:00
parent 0fb87c5618
commit 24b830b455
+40 -19
View File
@@ -55,7 +55,7 @@
</section>
<?php endif; ?>
<!-- 3. ABOUT US -->
<!-- 3. ABOUT US / SAMBUTAN -->
<?php if ( get_option('edukarsa_tampil_about', 1) == 1 ) : ?>
<section class="edukarsa-section edukarsa-sambutan">
<div class="container sambutan-grid">
@@ -71,8 +71,8 @@
</div>
<div class="sambutan-content">
<span class="badge-title">ABOUT US</span>
<h2 class="section-title"><?php echo esc_html( get_option('edukarsa_nama_kepsek') ); ?></h2>
<h4 class="section-subtitle-strong" style="color:var(--primary-color); margin-bottom:15px; font-size:18px;"><?php echo esc_html( get_option('edukarsa_subtitle_about') ); ?></h4>
<h2 class="section-title"><?php echo esc_html( get_option('edukarsa_nama_kepsek', 'Nama Kepala Sekolah') ); ?></h2>
<h4 class="section-subtitle-strong" style="color:var(--primary-color); margin-bottom:15px; font-size:18px;"><?php echo esc_html( get_option('edukarsa_subtitle_about', 'Pimpinan Institusi') ); ?></h4>
<div class="sambutan-text"><?php echo wpautop( wp_kses_post( get_option('edukarsa_teks_sambutan') ) ); ?></div>
<a href="<?php echo esc_url( get_option('edukarsa_link_about', '#') ); ?>" class="btn-primary">Ketahui Lebih Lanjut</a>
</div>
@@ -80,28 +80,45 @@
</section>
<?php endif; ?>
<!-- 4. MILESTONES -->
<?php if ( get_option('edukarsa_tampil_milestone', 1) == 1 ) : ?>
<section class="edukarsa-section edukarsa-milestones bg-light-blue">
<!-- 4. MILESTONES (HANYA DITAMPILKAN JIKA ADA POSTINGAN) -->
<?php
if ( get_option('edukarsa_tampil_milestone', 1) == 1 ) :
$query_milestone = new WP_Query( array( 'post_type' => 'milestone', 'posts_per_page' => 4 ) );
if ( $query_milestone->have_posts() ) :
?>
<section class="edukarsa-section edukarsa-milestones bg-light-blue" style="padding: 50px 0;">
<div class="container milestone-grid text-center">
<?php
$query_milestone = new WP_Query( array( 'post_type' => 'milestone', 'posts_per_page' => 4 ) );
if ( $query_milestone->have_posts() ) :
while ( $query_milestone->have_posts() ) : $query_milestone->the_post();
echo '<div class="milestone-item card-style"><h3 class="milestone-title" style="color:var(--primary-color); font-size:28px; margin-bottom:5px;">' . get_the_title() . '</h3><div class="milestone-desc">' . get_the_excerpt() . '</div></div>';
endwhile;
wp_reset_postdata();
endif;
while ( $query_milestone->have_posts() ) : $query_milestone->the_post();
?>
<div class="milestone-item card-style" style="padding: 30px 20px;">
<h3 class="milestone-title" style="color: var(--primary-color); font-size: 36px; font-weight: 800; margin-bottom: 6px; line-height: 1;">
<?php the_title(); ?>
</h3>
<div class="milestone-desc" style="font-size: 14px; color: var(--text-muted); line-height: 1.5;">
<?php the_excerpt(); ?>
</div>
</div>
<?php
endwhile;
wp_reset_postdata();
?>
</div>
</section>
<?php endif; ?>
<?php
endif;
endif;
?>
<!-- 5. PROGRAM -->
<!-- 5. PROGRAM UNGGULAN -->
<?php if ( get_option('edukarsa_tampil_program', 1) == 1 ) : ?>
<section class="edukarsa-section edukarsa-programs">
<div class="container">
<div class="section-header text-center"><h2 class="section-title">Our Program</h2><hr class="title-underline"></div>
<div class="section-header text-center">
<span class="badge-title">AKADEMIK & KARAKTER</span>
<h2 class="section-title">Our Program</h2>
<hr class="title-underline">
</div>
<div class="program-grid">
<?php
$query_program = new WP_Query( array( 'post_type' => 'program', 'posts_per_page' => 3 ) );
@@ -116,8 +133,12 @@
<div class="img-placeholder"><i>🏫</i><span>Gambar Program</span></div>
<?php endif; ?>
</div>
<h3 style="margin-bottom:15px; color:var(--heading-color);"><?php the_title(); ?></h3>
<div class="program-desc" style="margin-bottom:20px; font-size:14px; color:var(--text-muted);"><?php echo wp_trim_words( get_the_excerpt(), 15, '...' ); ?></div>
<h3 style="margin-bottom: 12px; font-size: 20px; color: var(--heading-color); font-weight: 700;">
<?php the_title(); ?>
</h3>
<div class="program-desc" style="margin-bottom: 25px; font-size: 14px; color: var(--text-muted); line-height: 1.6;">
<?php echo wp_trim_words( get_the_excerpt(), 16, '...' ); ?>
</div>
<a href="<?php the_permalink(); ?>" class="btn-outline-primary">Lihat Detail</a>
</div>
<?php
@@ -182,7 +203,7 @@
<div class="keunggulan-number"><?php echo sprintf("%02d", $nomor); ?></div>
<div class="keunggulan-content-inner">
<h4><?php the_title(); ?></h4>
<div style="font-size: 14px; color: var(--text-muted);">
<div style="font-size: 14px; color: var(--text-muted); line-height: 1.6;">
<?php echo wp_trim_words( wp_strip_all_tags( get_the_content() ), 15, '...' ); ?>
</div>
</div>