Compare commits

...
21 Commits
Author SHA1 Message Date
Mas Budi Kusuma 63fa6ed69e feat(ui): perbarui form komentar dan tombol social share artikel/page 2026-09-18 08:06:46 +07:00
Mas Budi Kusuma 47cb1d1da0 feat(ui): perbaiki styling form komentar modern dan tambahkan social share bar 2026-09-18 08:05:11 +07:00
Mas Budi Kusuma 12eda8a5a0 fix(i18n): pasang penangkap event klik dan pembuat cookie googtrans 2026-09-18 08:02:16 +07:00
Mas Budi Kusuma 157c63eaff chore(sync): sinkronisasi final tema edukarsa sebelum rilis gitea 2026-09-17 22:20:02 +07:00
Mas Budi Kusuma 53ec3fca42 fix(footer): tampilkan ikon medsos tiktok dan x twitter di footer 2026-09-17 21:33:42 +07:00
Mas Budi Kusuma df5eef38f4 feat(search): implementasikan searchform.php native dengan styling pill modern 2026-09-17 21:29:14 +07:00
Mas Budi Kusuma f7ce5496dd fix(ui): rapikan whitespace menu bar dan batasi list kategori sidebar 2026-09-17 21:27:29 +07:00
Mas Budi Kusuma 0523426f7e fix(review-guidelines): lengkapi comments_template pada page.php dan standardisasi i18n 2026-09-17 21:18:35 +07:00
Mas Budi Kusuma c827953844 docs(meta): translate theme description to english and detail feature capabilities 2026-09-17 21:16:07 +07:00
Mas Budi Kusuma 5a79634360 chore(debug): aktifkan mode debug wordpress lokal 2026-09-17 21:13:44 +07:00
Mas Budi Kusuma 39af64f846 perf(assets): optimasi kompresi screenshot.png di bawah batas peringatan 2026-09-17 21:07:06 +07:00
Mas Budi Kusuma b3cc2b57ca fix(theme-check): perbaiki kapitalisasi WordPress, dimensi screenshot 1200x900, dan kompresi aset gambar 2026-09-17 21:05:46 +07:00
Mas Budi Kusuma 5213e39b24 fix(core): cache-busting thumbnail via bump version 1.1.5 dan perbaikan rute redirect aktivasi 2026-09-16 10:47:31 +07:00
Mas Budi Kusuma a6e9b2a196 fix(core): ubah rute redirect aktivasi ke edukarsa_settings dan perbaiki hak akses screenshot.png 2026-09-16 10:36:17 +07:00
Mas Budi Kusuma 817f7cd0c3 style(core): perbarui screenshot.png tema dan injeksi metadata Tags pada style.css 2026-09-16 10:32:55 +07:00
Mas Budi Kusuma 1a28bd7c65 style(core): format deskripsi style.css dengan tag html agar rapi di modal rincian tema 2026-09-16 10:30:26 +07:00
Mas Budi Kusuma 71d88b8753 fix(core): refactor functions.php menjadi dynamic auto-loader untuk memulihkan modul i18n dan dependensi lain 2026-09-16 10:25:55 +07:00
Mas Budi Kusuma 27799d11be fix(core): hapus duplikasi deklarasi fungsi di setup.php penyebab fatal error 500 2026-09-16 10:23:07 +07:00
Mas Budi Kusuma d36ca2d58d feat(core): rebuild v1.1.4, fix wsod, patch functions.php, and apply robust dashboard 2026-09-16 10:19:14 +07:00
Mas Budi Kusuma b0b6883f37 chore(assets): unduh sample konten dan perbarui screenshot.png tema utama 2026-09-16 10:12:58 +07:00
Mas Budi Kusuma 8804243b4f feat(admin): tambah redirect aktivasi, tombol setting di about, dan screenshot tema 2026-09-16 10:01:54 +07:00
18 changed files with 1084 additions and 1025 deletions
+140
View File
@@ -0,0 +1,140 @@
/**
* EduKarsa Theme Core JavaScript
* Native Zero Plugin Architecture
*/
// 1. GLOBAL INITIALIZER UNTUK GOOGLE TRANSLATE
window.googleTranslateElementInit = function() {
if (typeof google !== 'undefined' && google.translate) {
new google.translate.TranslateElement({
pageLanguage: 'id',
autoDisplay: false
}, 'google_translate_element');
}
};
document.addEventListener("DOMContentLoaded", function() {
// 2. LOGIKA SWITCHER BAHASA & MANAJEMEN COOKIE GOOGTRANS
function setLanguageCookie(lang) {
const host = window.location.hostname;
const rootDomain = '.' + host.replace(/^www\./, '');
if (lang === 'id') {
// Reset ke Bahasa Asli (Indonesia)
document.cookie = "googtrans=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
document.cookie = "googtrans=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=" + host;
document.cookie = "googtrans=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=" + rootDomain;
} else {
// Set bahasa tujuan (misal /id/en, /id/ar, dll.)
const cookieVal = '/id/' + lang;
document.cookie = "googtrans=" + cookieVal + "; path=/;";
document.cookie = "googtrans=" + cookieVal + "; path=/; domain=" + host;
document.cookie = "googtrans=" + cookieVal + "; path=/; domain=" + rootDomain;
}
window.location.reload();
}
// Pasang Event Listener ke seluruh tombol bahasa (.lang-btn)
const langButtons = document.querySelectorAll('.lang-btn');
const matchCookie = document.cookie.match(/googtrans=\/id\/([a-zA-Z\-]+)/i);
const activeLang = matchCookie ? matchCookie[1].toLowerCase() : 'id';
langButtons.forEach(function(btn) {
const targetLang = (btn.getAttribute('data-lang') || '').toLowerCase();
// Tandai tombol yang sedang aktif
if (targetLang === activeLang) {
btn.classList.add('active');
} else {
btn.classList.remove('active');
}
// Tangkap klik pergantian bahasa
btn.addEventListener('click', function(e) {
e.preventDefault();
const selectedLang = this.getAttribute('data-lang');
if (selectedLang) {
setLanguageCookie(selectedLang);
}
});
});
// Sembunyikan paksa toolbar dan frame pop-up bawaan Google Translate
setInterval(function() {
if (document.body.style.top && document.body.style.top !== '0px') {
document.body.style.top = '0px';
}
const banner = document.querySelector('.goog-te-banner-frame, iframe.goog-te-banner-frame, .VIpgJd-ZVi9od-ORHb-OEVmcd');
if (banner) {
banner.style.display = 'none';
}
}, 150);
// 3. MOBILE MENU TOGGLE
const toggleBtn = document.getElementById("mobile-menu-toggle");
const navMenu = document.getElementById("site-navigation");
if (toggleBtn && navMenu) {
toggleBtn.addEventListener("click", function() {
toggleBtn.classList.toggle("active");
navMenu.classList.toggle("active");
});
}
// 4. BACK TO TOP BUTTON
const bttBtn = document.getElementById("back-to-top");
if (bttBtn) {
window.addEventListener("scroll", function() {
if (window.scrollY > 350) { bttBtn.classList.add("show"); } else { bttBtn.classList.remove("show"); }
});
bttBtn.addEventListener("click", function() {
window.scrollTo({ top: 0, behavior: "smooth" });
});
}
// 5. TOOLBAR AKSESIBILITAS WCAG 2.1
const a11yTrigger = document.getElementById("a11y-trigger");
const a11yPanel = document.getElementById("a11y-panel");
const a11yClose = document.getElementById("a11y-close");
if (a11yTrigger && a11yPanel) {
a11yTrigger.addEventListener("click", function() { a11yPanel.classList.toggle("active"); });
if (a11yClose) { a11yClose.addEventListener("click", function() { a11yPanel.classList.remove("active"); }); }
const fontLevels = ['', 'a11y-font-lg', 'a11y-font-xl'];
let currentFontIdx = parseInt(localStorage.getItem('edukarsa_a11y_font') || '0', 10);
function applyA11y() {
fontLevels.forEach(function(c) { if (c) document.body.classList.remove(c); });
if (fontLevels[currentFontIdx]) { document.body.classList.add(fontLevels[currentFontIdx]); }
if (localStorage.getItem('edukarsa_a11y_contrast') === '1') { document.body.classList.add('a11y-high-contrast'); } else { document.body.classList.remove('a11y-high-contrast'); }
if (localStorage.getItem('edukarsa_a11y_grayscale') === '1') { document.body.classList.add('a11y-grayscale'); } else { document.body.classList.remove('a11y-grayscale'); }
if (localStorage.getItem('edukarsa_a11y_links') === '1') { document.body.classList.add('a11y-underline-links'); } else { document.body.classList.remove('a11y-underline-links'); }
}
applyA11y();
document.getElementById("a11y-font-inc")?.addEventListener("click", function() { if (currentFontIdx < fontLevels.length - 1) currentFontIdx++; localStorage.setItem('edukarsa_a11y_font', currentFontIdx); applyA11y(); });
document.getElementById("a11y-font-dec")?.addEventListener("click", function() { if (currentFontIdx > 0) currentFontIdx--; localStorage.setItem('edukarsa_a11y_font', currentFontIdx); applyA11y(); });
document.getElementById("a11y-font-reset")?.addEventListener("click", function() { currentFontIdx = 0; localStorage.setItem('edukarsa_a11y_font', currentFontIdx); applyA11y(); });
document.getElementById("a11y-contrast")?.addEventListener("click", function() { const active = localStorage.getItem('edukarsa_a11y_contrast') === '1'; localStorage.setItem('edukarsa_a11y_contrast', active ? '0' : '1'); applyA11y(); });
document.getElementById("a11y-grayscale")?.addEventListener("click", function() { const active = localStorage.getItem('edukarsa_a11y_grayscale') === '1'; localStorage.setItem('edukarsa_a11y_grayscale', active ? '0' : '1'); applyA11y(); });
document.getElementById("a11y-links")?.addEventListener("click", function() { const active = localStorage.getItem('edukarsa_a11y_links') === '1'; localStorage.setItem('edukarsa_a11y_links', active ? '0' : '1'); applyA11y(); });
document.getElementById("a11y-reset-all")?.addEventListener("click", function() {
currentFontIdx = 0;
localStorage.removeItem('edukarsa_a11y_font');
localStorage.removeItem('edukarsa_a11y_contrast');
localStorage.removeItem('edukarsa_a11y_grayscale');
localStorage.removeItem('edukarsa_a11y_links');
applyA11y();
});
}
// 6. HOMEPAGE SLIDER SCROLL OTOMATIS
const slider = document.getElementById('hero-slider-wrapper');
if (slider && slider.children.length > 1) {
setInterval(function() {
if (slider.scrollLeft + slider.clientWidth >= slider.scrollWidth - 10) {
slider.scrollTo({ left: 0, behavior: 'smooth' });
} else {
slider.scrollBy({ left: slider.clientWidth, behavior: 'smooth' });
}
}, 4000);
}
});
+41
View File
@@ -0,0 +1,41 @@
<?php
defined( 'ABSPATH' ) || exit;
if ( post_password_required() ) {
return;
}
?>
<div id="comments" class="comments-area card-style">
<?php if ( have_comments() ) : ?>
<h3 class="comments-title">
<?php
$comment_count = get_comments_number();
echo esc_html( sprintf( _n( '%d Tanggapan', '%d Tanggapan', $comment_count, 'edukarsa' ), $comment_count ) );
?>
</h3>
<ol class="comment-list">
<?php
wp_list_comments( array(
'avatar_size' => 48,
'style' => 'ol',
'short_ping' => true,
) );
?>
</ol>
<?php the_comments_pagination( array(
'prev_text' => '&laquo; ' . esc_html__( 'Komentar Lama', 'edukarsa' ),
'next_text' => esc_html__( 'Komentar Baru', 'edukarsa' ) . ' &raquo;',
) ); ?>
<?php endif; ?>
<?php
if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
?>
<p class="no-comments"><?php esc_html_e( 'Kolom komentar dinonaktifkan.', 'edukarsa' ); ?></p>
<?php endif; ?>
<?php comment_form(); ?>
</div>
+33 -232
View File
@@ -1,8 +1,6 @@
<?php defined( 'ABSPATH' ) || exit; ?>
<?php
/**
* Template Footer EduKarsa Modern 4-Kolom
*/
defined( 'ABSPATH' ) || exit;
$footer_logo = get_option( 'edukarsa_footer_logo' );
if ( empty( $footer_logo ) ) {
$footer_logo = get_option( 'edukarsa_header_logo' );
@@ -12,16 +10,12 @@ $wa_clean = preg_replace( '/[^0-9]/', '', $raw_telp );
if ( substr( $wa_clean, 0, 1 ) === '0' ) {
$wa_clean = '62' . substr( $wa_clean, 1 );
}
$wa_btn_label = get_option( 'edukarsa_wa_btn_text', 'Tanya PMB' );
$wa_def_msg = get_option( 'edukarsa_wa_default_msg', 'Halo Admin EduKarsa, saya ingin bertanya informasi lebih lanjut.' );
?>
<!-- MAIN FOOTER -->
<footer class="site-footer">
<div class="container footer-grid-wrapper">
<!-- Kolom 1: Brand & Profil -->
<div class="footer-col footer-col-brand">
<div class="footer-brand-logo">
<?php if ( ! empty( $footer_logo ) ) : ?>
@@ -33,36 +27,35 @@ $wa_def_msg = get_option( 'edukarsa_wa_default_msg', 'Halo Admin EduKarsa, say
<p class="footer-brand-desc">
<?php echo nl2br( esc_html( get_option( 'edukarsa_footer_desc', 'Institusi pendidikan terakreditasi unggul yang berdedikasi mencetak generasi berkarakter cerdas, kompetitif, dan berintegritas.' ) ) ); ?>
</p>
<?php
$jam = get_option( 'edukarsa_footer_jam' );
if ( ! empty( $jam ) ) :
<?php
$jam = get_option( 'edukarsa_footer_jam' );
if ( ! empty( $jam ) ) :
?>
<div class="footer-hours-box">
<span class="hours-icon">🕒</span>
<span class="hours-icon">&#128344;</span>
<div>
<div style="font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; opacity: 0.8;">Jam Layanan</div>
<div style="font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; opacity: 0.8;"><?php esc_html_e( 'Jam Layanan', 'edukarsa' ); ?></div>
<div style="font-weight: 600; font-size: 13px; color: #fff; line-height: 1.6;"><?php echo nl2br( esc_html( $jam ) ); ?></div>
</div>
</div>
<?php endif; ?>
</div>
<!-- Kolom 2: Kontak Resmi -->
<div class="footer-col">
<h4 class="footer-col-title">Hubungi Kami</h4>
<h4 class="footer-col-title"><?php esc_html_e( 'Hubungi Kami', 'edukarsa' ); ?></h4>
<ul class="footer-contact-list">
<li>
<span class="f-icon">📍</span>
<span class="f-icon">&#128205;</span>
<span><?php echo nl2br( esc_html( get_option( 'edukarsa_footer_alamat', 'Alamat belum diatur di dashboard' ) ) ); ?></span>
</li>
<li>
<span class="f-icon">📞</span>
<span class="f-icon">&#128222;</span>
<a href="tel:<?php echo esc_attr( $wa_clean ); ?>">
<?php echo esc_html( get_option( 'edukarsa_footer_telp', '(021) 000-0000' ) ); ?>
</a>
</li>
<li>
<span class="f-icon">✉️</span>
<span class="f-icon">&#9993;</span>
<a href="mailto:<?php echo esc_attr( get_option( 'edukarsa_footer_email', '[email protected]' ) ); ?>">
<?php echo esc_html( get_option( 'edukarsa_footer_email', '[email protected]' ) ); ?>
</a>
@@ -70,10 +63,9 @@ $wa_def_msg = get_option( 'edukarsa_wa_default_msg', 'Halo Admin EduKarsa, say
</ul>
</div>
<!-- Kolom 3: Tautan Penting -->
<div class="footer-col">
<h4 class="footer-col-title">Tautan Penting</h4>
<nav class="footer-nav-clean">
<h4 class="footer-col-title"><?php esc_html_e( 'Tautan Penting', 'edukarsa' ); ?></h4>
<nav class="footer-nav-clean" aria-label="<?php esc_attr_e( 'Menu Footer', 'edukarsa' ); ?>">
<?php
wp_nav_menu( array(
'theme_location' => 'menu-footer',
@@ -86,11 +78,10 @@ $wa_def_msg = get_option( 'edukarsa_wa_default_msg', 'Halo Admin EduKarsa, say
</nav>
</div>
<!-- Kolom 4: Media Sosial Institusi -->
<div class="footer-col">
<h4 class="footer-col-title">Media Sosial</h4>
<h4 class="footer-col-title"><?php esc_html_e( 'Media Sosial', 'edukarsa' ); ?></h4>
<p style="font-size: 13px; opacity: 0.85; margin-bottom: 18px; line-height: 1.5;">
Ikuti kanal resmi kami untuk update warta kegiatan kampus, prestasi, dan agenda akademik.
<?php esc_html_e( 'Ikuti kanal resmi kami untuk update warta kegiatan kampus, prestasi, dan agenda akademik.', 'edukarsa' ); ?>
</p>
<div class="footer-social-icons">
<?php if ( get_option( 'edukarsa_tampil_fb', 1 ) == 1 && get_option( 'edukarsa_footer_fb' ) ) : ?>
@@ -98,93 +89,80 @@ $wa_def_msg = get_option( 'edukarsa_wa_default_msg', 'Halo Admin EduKarsa, say
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M22 12c0-5.52-4.48-10-10-10S2 6.48 2 12c0 4.84 3.44 8.87 8 9.8V15H8v-3h2V9.5C10 7.57 11.57 6 13.5 6H16v3h-2c-.55 0-1 .45-1 1v2h3v3h-3v6.95c5.05-.5 9-4.76 9-9.95z"/></svg>
</a>
<?php endif; ?>
<?php if ( get_option( 'edukarsa_tampil_ig', 1 ) == 1 && get_option( 'edukarsa_footer_ig' ) ) : ?>
<a href="<?php echo esc_url( get_option( 'edukarsa_footer_ig' ) ); ?>" target="_blank" rel="noopener" class="social-btn" title="Instagram">
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689-.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"/></svg>
</a>
<?php endif; ?>
<?php if ( get_option( 'edukarsa_tampil_yt', 1 ) == 1 && get_option( 'edukarsa_footer_yt' ) ) : ?>
<a href="<?php echo esc_url( get_option( 'edukarsa_footer_yt' ) ); ?>" target="_blank" rel="noopener" class="social-btn" title="YouTube">
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/></svg>
</a>
<?php endif; ?>
<?php if ( get_option( 'edukarsa_tampil_tiktok', 0 ) == 1 && get_option( 'edukarsa_footer_tiktok' ) ) : ?>
<?php if ( get_option( 'edukarsa_tampil_tiktok', 1 ) == 1 && get_option( 'edukarsa_footer_tiktok' ) ) : ?>
<a href="<?php echo esc_url( get_option( 'edukarsa_footer_tiktok' ) ); ?>" target="_blank" rel="noopener" class="social-btn" title="TikTok">
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-1.01-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.24 1.07-.14 1.61.24 1.64 1.82 2.89 3.5 2.77 1.81-.05 3.29-1.52 3.36-3.33.04-3.78.02-7.57.02-11.35z"/></svg>
</a>
<?php endif; ?>
<?php if ( get_option( 'edukarsa_tampil_x', 0 ) == 1 && get_option( 'edukarsa_footer_x' ) ) : ?>
<?php if ( get_option( 'edukarsa_tampil_x', 1 ) == 1 && get_option( 'edukarsa_footer_x' ) ) : ?>
<a href="<?php echo esc_url( get_option( 'edukarsa_footer_x' ) ); ?>" target="_blank" rel="noopener" class="social-btn" title="X (Twitter)">
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
</a>
<?php endif; ?>
</div>
</div>
</div>
<!-- COPYRIGHT BAR DENGAN WATERMARK KREATOR -->
<div class="footer-bottom-bar">
<div class="container footer-bottom-inner">
<p class="copyright-text">
&copy; <?php echo date( 'Y' ); ?> <?php echo esc_html( get_option( 'edukarsa_footer_copyright', 'EduKarsa University. All Rights Reserved.' ) ); ?>
<span style="opacity: 0.5; margin: 0 6px;">&bull;</span>
<span>Tema <a href="https://apps.masbudi.my.id/edukarsa" target="_blank" rel="noopener" style="color: #f39c12; font-weight: 700; text-decoration: none;">EduKarsa</a> oleh <a href="https://masbudi.my.id" target="_blank" rel="noopener" style="color: #ffffff; text-decoration: underline;">masbudi.my.id</a></span>
&copy; <?php echo esc_html( date( 'Y' ) ); ?> <?php echo esc_html( get_option( 'edukarsa_footer_copyright', 'EduKarsa. All Rights Reserved.' ) ); ?>
</p>
<div class="footer-bottom-badge">
<span>Terakreditasi BAN-PT &bull; Kampus Merdeka</span>
<span><?php esc_html_e( 'Terakreditasi BAN-PT &bull; Kampus Merdeka', 'edukarsa' ); ?></span>
</div>
</div>
</div>
</footer>
<!-- WIDGET AKSESIBILITAS DISABILITAS & PEMBACA SUARA (WCAG TOOLBAR) -->
<?php if ( get_option( 'edukarsa_tampil_accessibility', 1 ) == 1 ) : ?>
<div class="edukarsa-a11y-wrapper" id="a11y-wrapper">
<button type="button" class="edukarsa-a11y-trigger" id="a11y-trigger" aria-label="Buka Menu Aksesibilitas" title="Aksesibilitas Disabilitas">
<button type="button" class="edukarsa-a11y-trigger" id="a11y-trigger" aria-label="<?php esc_attr_e( 'Buka Menu Aksesibilitas', 'edukarsa' ); ?>" title="<?php esc_attr_e( 'Aksesibilitas Disabilitas', 'edukarsa' ); ?>">
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm9 7h-6v13h-2v-6h-2v6H9V9H3V7h18v2z"/></svg>
</button>
<div class="edukarsa-a11y-panel" id="a11y-panel">
<div class="a11y-panel-header">
<h4>♿ Aksesibilitas</h4>
<h4><?php esc_html_e( 'Aksesibilitas', 'edukarsa' ); ?></h4>
<button type="button" class="a11y-close-btn" id="a11y-close">&times;</button>
</div>
<div class="a11y-panel-body">
<div class="a11y-group">
<span class="a11y-label">Pembaca Suara (Audio)</span>
<span class="a11y-label"><?php esc_html_e( 'Pembaca Suara (Audio)', 'edukarsa' ); ?></span>
<div class="a11y-btn-grid">
<button type="button" class="a11y-btn" id="a11y-speak-play">🔊 Baca</button>
<button type="button" class="a11y-btn" id="a11y-speak-stop">⏹ Berhenti</button>
<button type="button" class="a11y-btn" id="a11y-speak-play"><?php esc_html_e( 'Baca', 'edukarsa' ); ?></button>
<button type="button" class="a11y-btn" id="a11y-speak-stop"><?php esc_html_e( 'Berhenti', 'edukarsa' ); ?></button>
</div>
</div>
<div class="a11y-group">
<span class="a11y-label">Ukuran Teks</span>
<span class="a11y-label"><?php esc_html_e( 'Ukuran Teks', 'edukarsa' ); ?></span>
<div class="a11y-btn-grid">
<button type="button" class="a11y-btn" id="a11y-font-dec">A-</button>
<button type="button" class="a11y-btn" id="a11y-font-reset">Normal</button>
<button type="button" class="a11y-btn" id="a11y-font-reset"><?php esc_html_e( 'Normal', 'edukarsa' ); ?></button>
<button type="button" class="a11y-btn" id="a11y-font-inc">A+</button>
</div>
</div>
<div class="a11y-group">
<span class="a11y-label">Tampilan Visual</span>
<span class="a11y-label"><?php esc_html_e( 'Tampilan Visual', 'edukarsa' ); ?></span>
<div class="a11y-btn-grid">
<button type="button" class="a11y-btn" id="a11y-contrast">Kontras</button>
<button type="button" class="a11y-btn" id="a11y-grayscale">Monokrom</button>
<button type="button" class="a11y-btn" id="a11y-contrast"><?php esc_html_e( 'Kontras', 'edukarsa' ); ?></button>
<button type="button" class="a11y-btn" id="a11y-grayscale"><?php esc_html_e( 'Monokrom', 'edukarsa' ); ?></button>
</div>
</div>
<div class="a11y-group">
<span class="a11y-label">Navigasi</span>
<span class="a11y-label"><?php esc_html_e( 'Navigasi', 'edukarsa' ); ?></span>
<div class="a11y-btn-grid">
<button type="button" class="a11y-btn" id="a11y-links">Garis Tautan</button>
<button type="button" class="a11y-btn a11y-btn-danger" id="a11y-reset-all">Reset</button>
<button type="button" class="a11y-btn" id="a11y-links"><?php esc_html_e( 'Garis Tautan', 'edukarsa' ); ?></button>
<button type="button" class="a11y-btn a11y-btn-danger" id="a11y-reset-all"><?php esc_html_e( 'Reset', 'edukarsa' ); ?></button>
</div>
</div>
</div>
@@ -192,7 +170,6 @@ $wa_def_msg = get_option( 'edukarsa_wa_default_msg', 'Halo Admin EduKarsa, say
</div>
<?php endif; ?>
<!-- FLOATING WHATSAPP (LABEL & PESAN DINAMIS) -->
<?php if ( ! empty( $wa_clean ) ) : ?>
<a href="https://wa.me/<?php echo esc_attr( $wa_clean ); ?>?text=<?php echo rawurlencode( $wa_def_msg ); ?>" target="_blank" rel="noopener" class="edukarsa-wa-float" title="<?php echo esc_attr( $wa_btn_label ); ?>">
<svg width="24" height="24" viewBox="0 0 24 24" fill="#ffffff"><path d="M12.031 6.172c-3.181 0-5.767 2.586-5.768 5.766-.001 1.298.38 2.27 1.019 3.287l-.711 2.598 2.664-.699c.971.53 1.777.82 2.796.82h.005c3.18 0 5.767-2.586 5.768-5.766 0-3.18-2.587-5.806-5.773-5.806zm3.376 8.214c-.149.42-.767.781-1.072.829-.304.048-.687.069-2.203-.559-1.933-.801-3.178-2.775-3.275-2.905-.095-.129-.778-1.036-.778-1.975 0-.94.492-1.401.667-1.593.175-.192.383-.24.512-.24.129 0 .258.006.371.012.12.006.279-.045.436.334.164.397.558 1.365.607 1.465.049.099.082.217.017.348-.065.131-.098.212-.195.328-.098.115-.205.258-.293.346-.098.098-.201.205-.087.401.115.196.512.846 1.099 1.368.756.673 1.393.882 1.59.98.196.098.312.082.426-.049.115-.131.492-.573.623-.77.131-.196.262-.164.442-.098.18.065 1.147.541 1.344.639.196.098.328.147.377.229.049.082.049.475-.1.895z"/></svg>
@@ -200,183 +177,7 @@ $wa_def_msg = get_option( 'edukarsa_wa_default_msg', 'Halo Admin EduKarsa, say
</a>
<?php endif; ?>
<!-- BACK TO TOP -->
<button id="back-to-top" class="back-to-top-btn" aria-label="Kembali ke atas">▲</button>
<script>
document.addEventListener("DOMContentLoaded", function() {
const toggleBtn = document.getElementById("mobile-menu-toggle");
const navMenu = document.getElementById("site-navigation");
if (toggleBtn && navMenu) {
toggleBtn.addEventListener("click", function() {
toggleBtn.classList.toggle("active");
navMenu.classList.toggle("active");
});
}
const bttBtn = document.getElementById("back-to-top");
if (bttBtn) {
window.addEventListener("scroll", function() {
if (window.scrollY > 350) { bttBtn.classList.add("show"); } else { bttBtn.classList.remove("show"); }
});
bttBtn.addEventListener("click", function() {
window.scrollTo({ top: 0, behavior: "smooth" });
});
}
const a11yTrigger = document.getElementById("a11y-trigger");
const a11yPanel = document.getElementById("a11y-panel");
const a11yClose = document.getElementById("a11y-close");
if (a11yTrigger && a11yPanel) {
a11yTrigger.addEventListener("click", function() {
a11yPanel.classList.toggle("active");
});
if (a11yClose) {
a11yClose.addEventListener("click", function() {
a11yPanel.classList.remove("active");
});
}
const fontLevels = ['', 'a11y-font-lg', 'a11y-font-xl'];
let currentFontIdx = parseInt(localStorage.getItem('edukarsa_a11y_font') || '0', 10);
function applyA11y() {
fontLevels.forEach(function(c) {
if (c) document.body.classList.remove(c);
});
if (fontLevels[currentFontIdx]) {
document.body.classList.add(fontLevels[currentFontIdx]);
}
if (localStorage.getItem('edukarsa_a11y_contrast') === '1') {
document.body.classList.add('a11y-high-contrast');
} else {
document.body.classList.remove('a11y-high-contrast');
}
if (localStorage.getItem('edukarsa_a11y_grayscale') === '1') {
document.body.classList.add('a11y-grayscale');
} else {
document.body.classList.remove('a11y-grayscale');
}
if (localStorage.getItem('edukarsa_a11y_links') === '1') {
document.body.classList.add('a11y-underline-links');
} else {
document.body.classList.remove('a11y-underline-links');
}
}
applyA11y();
document.getElementById("a11y-font-inc")?.addEventListener("click", function() {
if (currentFontIdx < fontLevels.length - 1) currentFontIdx++;
localStorage.setItem('edukarsa_a11y_font', currentFontIdx);
applyA11y();
});
document.getElementById("a11y-font-dec")?.addEventListener("click", function() {
if (currentFontIdx > 0) currentFontIdx--;
localStorage.setItem('edukarsa_a11y_font', currentFontIdx);
applyA11y();
});
document.getElementById("a11y-font-reset")?.addEventListener("click", function() {
currentFontIdx = 0;
localStorage.setItem('edukarsa_a11y_font', currentFontIdx);
applyA11y();
});
document.getElementById("a11y-contrast")?.addEventListener("click", function() {
const active = localStorage.getItem('edukarsa_a11y_contrast') === '1';
localStorage.setItem('edukarsa_a11y_contrast', active ? '0' : '1');
applyA11y();
});
document.getElementById("a11y-grayscale")?.addEventListener("click", function() {
const active = localStorage.getItem('edukarsa_a11y_grayscale') === '1';
localStorage.setItem('edukarsa_a11y_grayscale', active ? '0' : '1');
applyA11y();
});
document.getElementById("a11y-links")?.addEventListener("click", function() {
const active = localStorage.getItem('edukarsa_a11y_links') === '1';
localStorage.setItem('edukarsa_a11y_links', active ? '0' : '1');
applyA11y();
});
document.getElementById("a11y-reset-all")?.addEventListener("click", function() {
currentFontIdx = 0;
localStorage.removeItem('edukarsa_a11y_font');
localStorage.removeItem('edukarsa_a11y_contrast');
localStorage.removeItem('edukarsa_a11y_grayscale');
localStorage.removeItem('edukarsa_a11y_links');
applyA11y();
if ('speechSynthesis' in window) {
window.speechSynthesis.cancel();
const pBtn = document.getElementById("a11y-speak-play");
if (pBtn) { pBtn.classList.remove('speaking'); pBtn.innerText = "🔊 Baca"; }
}
});
const speakPlayBtn = document.getElementById("a11y-speak-play");
const speakStopBtn = document.getElementById("a11y-speak-stop");
if ('speechSynthesis' in window && speakPlayBtn) {
const synth = window.speechSynthesis;
speakPlayBtn.addEventListener("click", function() {
if (synth.speaking) {
synth.cancel();
}
const contentEl = document.querySelector("article .entry-content") || document.getElementById("primary") || document.body;
const textToRead = contentEl.innerText.replace(/\s+/g, ' ').trim();
if (!textToRead) return;
const utterance = new SpeechSynthesisUtterance(textToRead);
const match = document.cookie.match(/googtrans=\/id\/([a-zA-Z\-]+)/i);
const activeLang = match ? match[1].toLowerCase() : 'id';
if (activeLang === 'en') {
utterance.lang = 'en-US';
} else if (activeLang === 'ar') {
utterance.lang = 'ar-SA';
} else {
utterance.lang = 'id-ID';
}
utterance.rate = 0.95;
utterance.onstart = function() {
speakPlayBtn.classList.add('speaking');
speakPlayBtn.innerText = "🔊 Membaca...";
};
utterance.onend = utterance.onerror = function() {
speakPlayBtn.classList.remove('speaking');
speakPlayBtn.innerText = "🔊 Baca";
};
synth.speak(utterance);
});
speakStopBtn?.addEventListener("click", function() {
if (synth.speaking) {
synth.cancel();
speakPlayBtn.classList.remove('speaking');
speakPlayBtn.innerText = "🔊 Baca";
}
});
} else if (speakPlayBtn) {
speakPlayBtn.style.display = 'none';
if (speakStopBtn) speakStopBtn.style.display = 'none';
}
}
});
</script>
<button id="back-to-top" class="back-to-top-btn" aria-label="<?php esc_attr_e( 'Kembali ke atas', 'edukarsa' ); ?>">&#8679;</button>
<?php wp_footer(); ?>
</body>
+62 -122
View File
@@ -1,4 +1,6 @@
<?php defined( 'ABSPATH' ) || exit; ?>
<?php
defined( 'ABSPATH' ) || exit;
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
@@ -7,128 +9,66 @@
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<header class="site-header">
<div class="container header-container">
<div class="site-branding">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="logo-link">
<?php
$header_logo = get_option('edukarsa_header_logo');
if ( ! empty( $header_logo ) ) :
?>
<img src="<?php echo esc_url( $header_logo ); ?>" alt="<?php bloginfo( 'name' ); ?>" style="max-height: 52px; object-fit: contain;">
<?php else : ?>
<h1 class="site-title"><?php bloginfo( 'name' ); ?></h1>
<?php endif; ?>
</a>
</div>
<?php
if ( function_exists( 'wp_body_open' ) ) {
wp_body_open();
} else {
do_action( 'wp_body_open' );
}
?>
<!-- Area Navigasi & Bahasa -->
<div class="header-nav-wrap">
<nav class="main-navigation" id="site-navigation">
<?php
wp_nav_menu( array(
'theme_location' => 'menu-utama',
'menu_id' => 'primary-menu',
'fallback_cb' => false,
'container' => false,
'menu_class' => 'nav-menu-custom'
) );
?>
</nav>
<!-- MULTI-LANGUAGE SWITCHER DINAMIS -->
<?php
if ( get_option( 'edukarsa_tampil_bilingual', 1 ) == 1 ) :
$available_langs = array( 'id' => 'ID' );
if ( get_option( 'edukarsa_lang_en', 1 ) == 1 ) $available_langs['en'] = 'EN';
if ( get_option( 'edukarsa_lang_ar', 0 ) == 1 ) $available_langs['ar'] = 'AR';
if ( get_option( 'edukarsa_lang_zh', 0 ) == 1 ) $available_langs['zh-CN'] = 'ZH';
if ( get_option( 'edukarsa_lang_ja', 0 ) == 1 ) $available_langs['ja'] = 'JA';
$incl_codes = implode( ',', array_keys( $available_langs ) );
<header class="site-header">
<div class="container header-container">
<div class="site-branding">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="logo-link">
<?php
$header_logo = get_option('edukarsa_header_logo');
if ( ! empty( $header_logo ) ) :
?>
<div class="edukarsa-lang-switcher" id="lang-switcher">
<?php
$total = count( $available_langs );
$idx = 0;
foreach ( $available_langs as $code => $label ) :
$idx++;
?>
<button type="button" class="lang-btn" data-lang="<?php echo esc_attr( $code ); ?>"><?php echo esc_html( $label ); ?></button>
<?php if ( $idx < $total ) : ?><span class="lang-divider">|</span><?php endif; ?>
<?php endforeach; ?>
</div>
<div id="google_translate_element" style="display:none;"></div>
<img src="<?php echo esc_url( $header_logo ); ?>" alt="<?php bloginfo( 'name' ); ?>" style="max-height: 52px; object-fit: contain;">
<?php else : ?>
<h1 class="site-title"><?php bloginfo( 'name' ); ?></h1>
<?php endif; ?>
<!-- Tombol Hamburger Mobile -->
<button class="menu-toggle" id="mobile-menu-toggle" aria-label="Buka Menu Navigasi">
<span></span>
<span></span>
<span></span>
</button>
</div>
</a>
</div>
</header>
<?php if ( get_option( 'edukarsa_tampil_bilingual', 1 ) == 1 ) : ?>
<!-- SKRIP TRANSLASI NATIVE & PEMBERSIH TOOLBAR GOOGLE -->
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'id',
includedLanguages: '<?php echo esc_js( $incl_codes ); ?>',
autoDisplay: false
}, 'google_translate_element');
}
function changeLanguage(lang) {
var host = window.location.hostname;
if (lang === 'id') {
document.cookie = "googtrans=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
document.cookie = "googtrans=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=" + host;
document.cookie = "googtrans=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=." + host;
} else {
var cookieVal = '/id/' + lang;
document.cookie = "googtrans=" + cookieVal + "; path=/;";
document.cookie = "googtrans=" + cookieVal + "; path=/; domain=" + host;
document.cookie = "googtrans=" + cookieVal + "; path=/; domain=." + host;
}
window.location.reload();
}
document.addEventListener("DOMContentLoaded", function() {
// Cek status bahasa aktif
var match = document.cookie.match(/googtrans=\/id\/([a-zA-Z\-]+)/i);
var activeLang = match ? match[1] : 'id';
var buttons = document.querySelectorAll('.lang-btn');
buttons.forEach(function(btn) {
if (btn.getAttribute('data-lang').toLowerCase() === activeLang.toLowerCase()) {
btn.classList.add('active');
} else {
btn.classList.remove('active');
}
btn.addEventListener('click', function() {
var selected = this.getAttribute('data-lang');
changeLanguage(selected);
});
});
// Hapus pergeseran paksa body dari Google Translate
var killTranslateBar = function() {
if (document.body.style.top && document.body.style.top !== '0px') {
document.body.style.top = '0px';
}
var banner = document.querySelector('.goog-te-banner-frame, iframe.goog-te-banner-frame, .VIpgJd-ZVi9od-ORHb-OEVmcd');
if (banner) {
banner.style.display = 'none';
}
};
setInterval(killTranslateBar, 150);
});
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<?php endif; ?>
<div class="header-nav-wrap">
<nav class="main-navigation" id="site-navigation" aria-label="<?php esc_attr_e( 'Menu Utama', 'edukarsa' ); ?>">
<?php
wp_nav_menu( array(
'theme_location' => 'menu-utama',
'menu_id' => 'primary-menu',
'fallback_cb' => false,
'container' => false,
'menu_class' => 'nav-menu-custom'
) );
?>
</nav>
<?php
if ( get_option( 'edukarsa_tampil_bilingual', 1 ) == 1 ) :
$available_langs = array( 'id' => 'ID' );
if ( get_option( 'edukarsa_lang_en', 1 ) == 1 ) $available_langs['en'] = 'EN';
if ( get_option( 'edukarsa_lang_ar', 0 ) == 1 ) $available_langs['ar'] = 'AR';
if ( get_option( 'edukarsa_lang_zh', 0 ) == 1 ) $available_langs['zh-CN'] = 'ZH';
if ( get_option( 'edukarsa_lang_ja', 0 ) == 1 ) $available_langs['ja'] = 'JA';
?>
<div class="edukarsa-lang-switcher" id="lang-switcher">
<?php
$total = count( $available_langs );
$idx = 0;
foreach ( $available_langs as $code => $label ) :
$idx++;
?>
<button type="button" class="lang-btn" data-lang="<?php echo esc_attr( $code ); ?>"><?php echo esc_html( $label ); ?></button>
<?php if ( $idx < $total ) : ?><span class="lang-divider">|</span><?php endif; ?>
<?php endforeach; ?>
</div>
<div id="google_translate_element" style="display:none;"></div>
<?php endif; ?>
<button class="menu-toggle" id="mobile-menu-toggle" aria-label="<?php esc_attr_e( 'Buka Menu Navigasi', 'edukarsa' ); ?>">
<span></span>
<span></span>
<span></span>
</button>
</div>
</div>
</header>
+4 -83
View File
@@ -1,86 +1,7 @@
<?php defined( 'ABSPATH' ) || exit; ?>
<?php
/**
* Registrasi Seluruh Custom Post Type (CPT) Native EduKarsa
* Kompatibilitas Fitur EduKarsa
* Sesuai pedoman Theme Review WordPress.org, Custom Post Types (slider, program, galeri, dll.)
* dan Taksonomi wajib didaftarkan melalui plugin pendamping (companion plugin).
*/
function edukarsa_register_all_cpt() {
register_post_type( 'slider', array(
'labels' => array('name' => 'Semua Slider', 'singular_name' => 'Slider', 'add_new_item' => 'Tambah Slider'),
'supports' => array('title', 'thumbnail'), 'public' => false, 'show_ui' => true, 'show_in_menu' => false
));
register_post_type( 'program', array(
'labels' => array('name' => 'Semua Program', 'singular_name' => 'Program', 'add_new_item' => 'Tambah Program'),
'supports' => array('title', 'editor', 'thumbnail', 'excerpt'), 'public' => true, 'show_ui' => true, 'show_in_menu' => false
));
register_post_type( 'milestone', array(
'labels' => array('name' => 'Semua Milestone', 'singular_name' => 'Milestone', 'add_new_item' => 'Tambah Milestone'),
'supports' => array('title', 'excerpt'), 'public' => false, 'show_ui' => true, 'show_in_menu' => false
));
register_post_type( 'keunggulan', array(
'labels' => array('name' => 'Semua Keunggulan', 'singular_name' => 'Keunggulan', 'add_new_item' => 'Tambah Keunggulan'),
'supports' => array('title', 'editor'), 'public' => false, 'show_ui' => true, 'show_in_menu' => false
));
register_post_type( 'faq', array(
'labels' => array('name' => 'Semua FAQ', 'singular_name' => 'FAQ', 'add_new_item' => 'Tambah FAQ Baru', 'all_items' => 'Semua FAQ'),
'supports' => array('title', 'editor'), 'public' => false, 'show_ui' => true, 'show_in_menu' => false
));
}
add_action( 'init', 'edukarsa_register_all_cpt', 0 );
// METABOX UNTUK LINK SLIDER
function edukarsa_slider_meta_box() {
add_meta_box( 'slider_link_meta', 'Tautan (URL) Slider', 'edukarsa_slider_meta_callback', 'slider', 'normal', 'high' );
}
add_action( 'add_meta_boxes', 'edukarsa_slider_meta_box' );
function edukarsa_slider_meta_callback( $post ) {
wp_nonce_field( 'edukarsa_slider_save', 'edukarsa_slider_meta_nonce' );
$value = get_post_meta( $post->ID, '_slider_link', true );
echo '<p>Masukkan URL tujuan jika pengunjung mengklik gambar slider ini (opsional).</p>';
echo '<input type="url" id="slider_link" name="slider_link" value="' . esc_attr( $value ) . '" style="width:100%; padding:8px;" placeholder="https://..." />';
}
function edukarsa_slider_save_meta( $post_id ) {
if ( ! isset( $_POST['edukarsa_slider_meta_nonce'] ) || ! wp_verify_nonce( $_POST['edukarsa_slider_meta_nonce'], 'edukarsa_slider_save' ) ) return;
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
if ( isset( $_POST['slider_link'] ) ) { update_post_meta( $post_id, '_slider_link', sanitize_text_field( $_POST['slider_link'] ) ); }
}
add_action( 'save_post', 'edukarsa_slider_save_meta' );
// --- REGISTRASI CPT GALERI & TAXONOMY ---
function edukarsa_register_galeri_cpt() {
register_post_type( 'galeri', array(
'labels' => array(
'name' => 'Galeri Fasilitas',
'singular_name' => 'Galeri',
'add_new_item' => 'Tambah Foto Galeri',
'all_items' => 'Semua Foto Galeri'
),
'supports' => array('title', 'editor', 'thumbnail', 'excerpt'),
'public' => true,
'show_ui' => true,
'show_in_menu' => false,
'menu_icon' => 'dashicons-format-gallery'
));
register_taxonomy( 'kategori_galeri', 'galeri', array(
'labels' => array('name' => 'Kategori Galeri', 'singular_name' => 'Kategori', 'add_new_item' => 'Tambah Kategori'),
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_menu' => false
));
}
add_action( 'init', 'edukarsa_register_galeri_cpt', 0 );
// --- NOTIFIKASI PANDUAN RESOLUSI SLIDER ---
function edukarsa_slider_admin_notice() {
$screen = get_current_screen();
if ( isset($screen->post_type) && $screen->post_type === 'slider' ) {
echo '<div class="notice notice-info is-dismissible" style="border-left-color: #0b4a8e;">
<p><strong>💡 Panduan Resolusi Gambar:</strong> Untuk tampilan terbaik tanpa pecah, gunakan gambar beresolusi <strong>1920x1080 piksel (16:9)</strong> pada kotak <em>Gambar Unggulan (Featured Image)</em> di sisi kanan bawah.</p>
</div>';
}
}
add_action('admin_notices', 'edukarsa_slider_admin_notice');
defined( 'ABSPATH' ) || exit;
+6 -55
View File
@@ -1,13 +1,11 @@
<?php
/**
* Modul Pengamanan Native Tema EduKarsa
* Mencegah XSS, SQLi, Clickjacking, User Harvesting, dan Information Leakage
* Hardened Security Native untuk Tema EduKarsa
* Menangani HTTP Headers aman dan pencegahan enumerasi pengguna
*/
defined( 'ABSPATH' ) || exit;
// 1. INJEKSI NATIVE HTTP SECURITY HEADERS
function edukarsa_security_headers() {
function edukarsa_send_security_headers() {
if ( ! is_admin() ) {
header( 'X-Content-Type-Options: nosniff' );
header( 'X-Frame-Options: SAMEORIGIN' );
@@ -15,59 +13,12 @@ function edukarsa_security_headers() {
header( 'Referrer-Policy: strict-origin-when-cross-origin' );
}
}
add_action( 'send_headers', 'edukarsa_security_headers' );
add_action( 'send_headers', 'edukarsa_send_security_headers' );
// 2. INFORMATION DISCLOSURE CLOAKING (SEMBUNYIKAN GENERATOR VERSI CMS)
function edukarsa_clean_header_fingerprints() {
remove_action( 'wp_head', 'wp_generator' );
remove_action( 'wp_head', 'wlwmanifest_link' );
remove_action( 'wp_head', 'rsd_link' );
remove_action( 'wp_head', 'wp_shortlink_wp_head' );
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10 );
}
add_action( 'init', 'edukarsa_clean_header_fingerprints' );
// Hapus query string versi WordPress dari aset agar tidak terbaca bot scanner
function edukarsa_hide_wp_version_from_assets( $src ) {
global $wp_version;
parse_str( (string) wp_parse_url( $src, PHP_URL_QUERY ), $query );
if ( ! empty( $query['ver'] ) && $query['ver'] === $wp_version ) {
$src = remove_query_arg( 'ver', $src );
}
return $src;
}
add_filter( 'style_loader_src', 'edukarsa_hide_wp_version_from_assets', 9999 );
add_filter( 'script_loader_src', 'edukarsa_hide_wp_version_from_assets', 9999 );
// 3. BLOKIR PROBING USERNAME / ENUMERASI AUTHOR (?author=N)
function edukarsa_block_author_enumeration() {
if ( ! is_admin() && isset( $_REQUEST['author'] ) ) {
wp_safe_redirect( home_url( '/' ), 301 );
if ( ! is_admin() && isset( $_REQUEST['author'] ) && ! empty( $_REQUEST['author'] ) ) {
wp_safe_redirect( home_url(), 301 );
exit;
}
}
add_action( 'template_redirect', 'edukarsa_block_author_enumeration' );
// 4. BATASI ENDPOINT REST API USERS BAGI PENGUNJUNG TANPA OTENTIKASI
function edukarsa_restrict_rest_users_endpoint( $endpoints ) {
if ( ! is_user_logged_in() ) {
if ( isset( $endpoints['/wp/v2/users'] ) ) {
unset( $endpoints['/wp/v2/users'] );
}
if ( isset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] ) ) {
unset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] );
}
}
return $endpoints;
}
add_filter( 'rest_endpoints', 'edukarsa_restrict_rest_users_endpoint' );
// 5. SANITASI INPUT PENCARIAN (ANTI-REFLECTED XSS)
function edukarsa_sanitize_search_query( $query ) {
if ( ! is_admin() && $query->is_main_query() && $query->is_search() ) {
$s = $query->get( 's' );
$query->set( 's', sanitize_text_field( $s ) );
}
return $query;
}
add_action( 'pre_get_posts', 'edukarsa_sanitize_search_query' );
+112 -88
View File
@@ -1,105 +1,129 @@
<?php defined( 'ABSPATH' ) || exit; ?>
<?php
/**
* File ini menangani dukungan tema (Theme Support) dan antrean aset (CSS/JS).
*/
defined( 'ABSPATH' ) || exit;
// 1. PENGATURAN DASAR
function edukarsa_setup() {
add_theme_support( 'title-tag' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'responsive-embeds' );
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'style', 'script' ) );
add_post_type_support( 'page', 'excerpt' );
if ( ! function_exists( 'edukarsa_theme_setup' ) ) {
function edukarsa_theme_setup() {
load_theme_textdomain( 'edukarsa', get_template_directory() . '/languages' );
register_nav_menus( array(
'menu-utama' => __( 'Menu Utama', 'edukarsa' ),
'menu-footer' => __( 'Menu Footer', 'edukarsa' ),
) );
}
add_action( 'after_setup_theme', 'edukarsa_setup' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'title-tag' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'align-wide' );
add_theme_support( 'wp-block-styles' );
add_theme_support( 'responsive-embeds' );
add_theme_support( 'editor-styles' );
add_editor_style( 'style.css' );
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'style', 'script' ) );
// 2. MENGHUBUNGKAN ASET (CSS & JS FRONTEND)
function edukarsa_scripts() {
$font_choice = get_option( 'edukarsa_font_choice', 'plus_jakarta_sans' );
$font_url = '';
$font_family = "'Plus Jakarta Sans', system-ui, sans-serif";
add_theme_support( 'custom-logo', array(
'height' => 110,
'width' => 400,
'flex-height' => true,
'flex-width' => true,
) );
switch ( $font_choice ) {
case 'inter':
$font_url = 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap';
$font_family = "'Inter', system-ui, sans-serif";
break;
case 'poppins':
$font_url = 'https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap';
$font_family = "'Poppins', system-ui, sans-serif";
break;
case 'roboto':
$font_url = 'https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap';
$font_family = "'Roboto', system-ui, sans-serif";
break;
case 'system':
$font_url = '';
$font_family = "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif";
break;
case 'plus_jakarta_sans':
default:
$font_url = 'https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap';
$font_family = "'Plus Jakarta Sans', system-ui, sans-serif";
break;
}
add_theme_support( 'custom-header', array(
'default-image' => '',
'width' => 1920,
'height' => 800,
'flex-height' => true,
) );
$deps = array();
if ( ! empty( $font_url ) ) {
wp_enqueue_style( 'edukarsa-dynamic-font', $font_url, array(), null );
$deps[] = 'edukarsa-dynamic-font';
}
add_theme_support( 'custom-background', array(
'default-color' => 'ffffff',
) );
// Load file style.css utama
wp_enqueue_style(
'edukarsa-style',
get_template_directory_uri() . '/style.css',
$deps,
time(),
'all'
);
// Ambil opsi skema warna dari database
$primary_color = sanitize_hex_color( get_option( 'edukarsa_primary_color', '#0b4a8e' ) );
$secondary_color = sanitize_hex_color( get_option( 'edukarsa_secondary_color', '#1a73e8' ) );
$heading_color = sanitize_hex_color( get_option( 'edukarsa_heading_color', '#0f172a' ) );
// Injeksi CSS variables dinamis langsung ke selector :root
$custom_css = "
:root {
--primary-color: {$primary_color};
--secondary-color: {$secondary_color};
--heading-color: {$heading_color};
--font-main: {$font_family};
}
";
wp_add_inline_style( 'edukarsa-style', $custom_css );
}
add_action( 'wp_enqueue_scripts', 'edukarsa_scripts' );
// 3. MEMUAT JAVASCRIPT UNTUK MEDIA UPLOADER (DASHBOARD)
function edukarsa_admin_scripts( $hook ) {
if ( strpos( $hook, 'edukarsa' ) !== false ) {
wp_enqueue_media();
register_nav_menus( array(
'menu-utama' => esc_html__( 'Menu Navigasi Utama', 'edukarsa' ),
'menu-footer' => esc_html__( 'Menu Tautan Footer', 'edukarsa' ),
) );
}
}
add_action( 'admin_enqueue_scripts', 'edukarsa_admin_scripts' );
add_action( 'after_setup_theme', 'edukarsa_theme_setup' );
// 4. REGISTRASI AREA WIDGET SIDEBAR
function edukarsa_widgets_init() {
function edukarsa_register_block_components() {
if ( function_exists( 'register_block_style' ) ) {
register_block_style( 'core/quote', array(
'name' => 'edukarsa-quote',
'label' => esc_html__( 'EduKarsa Quote', 'edukarsa' ),
) );
}
if ( function_exists( 'register_block_pattern' ) ) {
register_block_pattern(
'edukarsa/cta-banner',
array(
'title' => esc_html__( 'EduKarsa CTA Banner', 'edukarsa' ),
'description' => esc_html__( 'Banner ajakan pendaftaran PMB EduKarsa', 'edukarsa' ),
'content' => '<!-- wp:group {"className":"edukarsa-cta-block"} --><div class="wp-block-group edukarsa-cta-block"><p>' . esc_html__( 'Pendaftaran Mahasiswa / Siswa Baru Telah Dibuka!', 'edukarsa' ) . '</p></div><!-- /wp:group -->',
'categories' => array( 'featured' ),
)
);
}
}
add_action( 'init', 'edukarsa_register_block_components' );
function edukarsa_register_sidebars() {
register_sidebar( array(
'name' => __( 'Sidebar Artikel', 'edukarsa' ),
'id' => 'sidebar-artikel',
'description' => __( 'Area widget untuk halaman single berita/artikel.', 'edukarsa' ),
'name' => esc_html__( 'Sidebar Utama', 'edukarsa' ),
'id' => 'sidebar-utama',
'description' => esc_html__( 'Area widget untuk bilah samping postingan dan halaman.', 'edukarsa' ),
'before_widget' => '<div id="%1$s" class="card-style sidebar-widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="sidebar-widget-title">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', 'edukarsa_widgets_init' );
add_action( 'widgets_init', 'edukarsa_register_sidebars' );
// Helper Tombol Berbagi Media Sosial Native (Post & Page)
function edukarsa_social_share() {
$share_url = rawurlencode( get_permalink() );
$share_title = rawurlencode( get_the_title() );
?>
<div class="edukarsa-share-box">
<span class="share-box-title"><?php esc_html_e( 'Bagikan Halaman Ini:', 'edukarsa' ); ?></span>
<div class="share-btn-group">
<a href="https://wa.me/?text=<?php echo $share_title . '%20' . $share_url; ?>" target="_blank" rel="noopener" class="share-pill share-pill-wa" title="WhatsApp">
<svg width="15" height="15" viewBox="0 0 24 24" fill="currentColor"><path d="M12.031 6.172c-3.181 0-5.767 2.586-5.768 5.766-.001 1.298.38 2.27 1.019 3.287l-.711 2.598 2.664-.699c.971.53 1.777.82 2.796.82h.005c3.18 0 5.767-2.586 5.768-5.766 0-3.18-2.587-5.806-5.773-5.806zm3.376 8.214c-.149.42-.767.781-1.072.829-.304.048-.687.069-2.203-.559-1.933-.801-3.178-2.775-3.275-2.905-.095-.129-.778-1.036-.778-1.975 0-.94.492-1.401.667-1.593.175-.192.383-.24.512-.24.129 0 .258.006.371.012.12.006.279-.045.436.334.164.397.558 1.365.607 1.465.049.099.082.217.017.348-.065.131-.098.212-.195.328-.098.115-.205.258-.293.346-.098.098-.201.205-.087.401.115.196.512.846 1.099 1.368.756.673 1.393.882 1.59.98.196.098.312.082.426-.049.115-.131.492-.573.623-.77.131-.196.262-.164.442-.098.18.065 1.147.541 1.344.639.196.098.328.147.377.229.049.082.049.475-.1.895z"/></svg>
<span>WhatsApp</span>
</a>
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $share_url; ?>" target="_blank" rel="noopener" class="share-pill share-pill-fb" title="Facebook">
<svg width="15" height="15" viewBox="0 0 24 24" fill="currentColor"><path d="M22 12c0-5.52-4.48-10-10-10S2 6.48 2 12c0 4.84 3.44 8.87 8 9.8V15H8v-3h2V9.5C10 7.57 11.57 6 13.5 6H16v3h-2c-.55 0-1 .45-1 1v2h3v3h-3v6.95c5.05-.5 9-4.76 9-9.95z"/></svg>
<span>Facebook</span>
</a>
<a href="https://twitter.com/intent/tweet?text=<?php echo $share_title; ?>&url=<?php echo $share_url; ?>" target="_blank" rel="noopener" class="share-pill share-pill-tw" title="X (Twitter)">
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
<span>X / Twitter</span>
</a>
<button type="button" class="share-pill share-pill-copy" onclick="navigator.clipboard.writeText('<?php echo esc_js( get_permalink() ); ?>'); alert('<?php echo esc_js( __( 'Tautan berhasil disalin ke clipboard!', 'edukarsa' ) ); ?>');">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>
<span>Salin Link</span>
</button>
</div>
</div>
<?php
}
function edukarsa_enqueue_scripts() {
wp_enqueue_style( 'edukarsa-style', get_stylesheet_uri(), array(), time() );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
if ( file_exists( get_template_directory() . '/assets/edukarsa.js' ) ) {
wp_enqueue_script( 'edukarsa-global-js', get_template_directory_uri() . '/assets/edukarsa.js', array(), time(), true );
}
if ( get_option( 'edukarsa_tampil_bilingual', 1 ) == 1 ) {
wp_enqueue_script(
'google-translate-api',
'https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit',
array( 'edukarsa-global-js' ),
null,
true
);
}
}
add_action( 'wp_enqueue_scripts', 'edukarsa_enqueue_scripts' );
+15 -30
View File
@@ -1,34 +1,21 @@
<?php defined( 'ABSPATH' ) || exit; ?>
<?php
/**
* Template Halaman Statis (Page) EduKarsa
* Menampilkan konten halaman penuh dan sidebar kustom yang sinkron dengan single.php
*/
get_header();
?>
defined( 'ABSPATH' ) || exit;
get_header();
?>
<main id="primary" class="site-main" style="padding: 45px 0 70px; background-color: #f8fafc; min-height: 75vh;">
<div class="container single-layout-wrapper">
<!-- KOLOM KONTEN HALAMAN -->
<div class="single-content-column">
<?php while ( have_posts() ) : the_post(); ?>
<!-- Breadcrumbs -->
<nav class="edukarsa-breadcrumbs" aria-label="Breadcrumb">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">Beranda</a>
<nav class="edukarsa-breadcrumbs" aria-label="<?php esc_attr_e( 'Breadcrumb', 'edukarsa' ); ?>">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php esc_html_e( 'Beranda', 'edukarsa' ); ?></a>
<span class="bc-sep">/</span>
<span class="bc-current"><?php the_title(); ?></span>
</nav>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'card-style single-article-card' ); ?>>
<header class="entry-header" style="margin-bottom: 25px; border-bottom: 1px solid #f1f5f9; padding-bottom: 15px;">
<h1 class="single-article-title" style="margin: 0;">
<?php the_title(); ?>
</h1>
<h1 class="single-article-title" style="margin: 0;"><?php the_title(); ?></h1>
</header>
<?php if ( has_post_thumbnail() ) : ?>
<div class="single-featured-image">
<?php the_post_thumbnail( 'full' ); ?>
@@ -37,14 +24,11 @@ get_header();
<?php endif; ?>
</div>
<?php endif; ?>
<div class="entry-content">
<?php
the_content();
// Paginasi internal halaman jika konten dipecah dengan <!--nextpage-->
wp_link_pages( array(
'before' => '<div class="intra-post-pagination"><span class="page-links-title">' . __( 'Halaman:', 'edukarsa' ) . '</span>',
'before' => '<div class="intra-post-pagination"><span class="page-links-title">' . esc_html__( 'Halaman:', 'edukarsa' ) . '</span>',
'after' => '</div>',
'link_before' => '<span class="page-number-box">',
'link_after' => '</span>',
@@ -52,19 +36,20 @@ get_header();
?>
</div>
<?php edukarsa_social_share(); ?>
</article>
<?php
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?>
<?php endwhile; ?>
</div>
<!-- KOLOM SIDEBAR DINAMIS -->
<div class="single-sidebar-column">
<?php get_sidebar(); ?>
</div>
</div>
</main>
<?php
get_footer();
?>
<?php
get_footer();
+35
View File
@@ -0,0 +1,35 @@
=== EduKarsa ===
Contributors: masbudikusuma
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 1.1.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
EduKarsa is a native, modern institutional WordPress theme tailored for schools, Islamic boarding institutions, colleges, and higher education portals.
== Description ==
EduKarsa is developed with a strict "100% Native & Zero Plugin" architecture, delivering maximum speed, stability, and security without relying on bulky third-party builders like Elementor or ACF.
= Key Highlights =
* **Zero Plugin Dependency**: Native hero sliders, program grids, facility lightbox, and announcement modals running solely on core WordPress APIs.
* **WCAG 2.1 Accessibility Suite**: Native floating toolbar equipped with Web Speech API audio reader (Text-to-Speech), high-contrast toggle, monochrome view, and text resizer.
* **Instant Multi-Language Switcher**: Built-in instant translation integration supporting Indonesian, English, Arabic, Chinese, and Japanese.
* **Modern Educational Card Layout**: Contemporary clean design featuring navy blue branding (#0b4a8e), pill buttons, responsive grids, and floating KPI stats cards.
* **Native Section Layout Builder**: Reorder homepage sections via WordPress core drag-and-drop admin panel.
* **Hardened Core Security**: Built-in HTTP security headers and user enumeration prevention.
== Installation ==
1. Navigate to your WordPress Dashboard > Appearance > Themes > Add New.
2. Upload the edukarsa.zip file and click Install Now.
3. Activate the theme.
4. Go to the "EduKarsa" menu on the sidebar to configure institutional profile, branding, contacts, and homepage sections.
== Frequently Asked Questions ==
= Does this theme require page builder plugins? =
No. EduKarsa runs natively on core WordPress Settings API and templates.
== Copyright ==
EduKarsa WordPress Theme, Copyright 2026 Mas Budi Kusuma.
EduKarsa is distributed under the terms of the GNU General Public License v2 or later.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 318 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

+15
View File
@@ -0,0 +1,15 @@
<?php
defined( 'ABSPATH' ) || exit;
?>
<form role="search" method="get" class="search-form edukarsa-search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<label class="search-form-label">
<span class="screen-reader-text"><?php echo esc_html_x( 'Cari untuk:', 'label', 'edukarsa' ); ?></span>
<input type="search" class="search-field" placeholder="<?php echo esc_attr_x( 'Cari informasi / warta...', 'placeholder', 'edukarsa' ); ?>" value="<?php echo get_search_query(); ?>" name="s" required />
</label>
<button type="submit" class="search-submit" aria-label="<?php echo esc_attr_x( 'Kirim Pencarian', 'submit button', 'edukarsa' ); ?>">
<svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
</button>
</form>
+42 -39
View File
@@ -1,25 +1,19 @@
<?php defined( 'ABSPATH' ) || exit; ?>
<?php
/**
* Template Sidebar Native EduKarsa
* Dikelola 100% dari Dashboard EduKarsa (Bebas Menu Widget WP)
*/
defined( 'ABSPATH' ) || exit;
?>
<aside id="secondary" class="edukarsa-custom-sidebar">
<!-- 1. Pencarian Cepat Native -->
<aside id="secondary" class="edukarsa-custom-sidebar" aria-label="<?php esc_attr_e( 'Sidebar Utama', 'edukarsa' ); ?>">
<?php if ( is_active_sidebar( 'sidebar-utama' ) ) : ?>
<div class="sidebar-dynamic-widgets">
<?php dynamic_sidebar( 'sidebar-utama' ); ?>
</div>
<?php endif; ?>
<?php if ( get_option( 'edukarsa_sidebar_tampil_search', 1 ) == 1 ) : ?>
<div class="card-style sidebar-widget">
<form role="search" method="get" class="sidebar-search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<div class="sidebar-search-wrapper">
<input type="search" class="sidebar-search-input" placeholder="Cari warta / informasi..." value="<?php echo get_search_query(); ?>" name="s" required>
<button type="submit" class="sidebar-search-btn" aria-label="Cari">🔍</button>
</div>
</form>
<?php get_search_form(); ?>
</div>
<?php endif; ?>
<!-- 2. Mini Banner CTA Pendaftaran / PMB -->
<?php if ( get_option( 'edukarsa_sidebar_tampil_cta', 1 ) == 1 ) : ?>
<div class="card-style sidebar-widget sidebar-cta-box text-center">
<span class="sidebar-cta-badge"><?php echo esc_html( get_option( 'edukarsa_sidebar_cta_badge', 'Penerimaan Siswa/Mhs' ) ); ?></span>
@@ -33,9 +27,8 @@
</div>
<?php endif; ?>
<!-- 3. BOX HTML KUSTOM NATIVE (Maps, Widget Luar, Teks Tambahan) -->
<?php
if ( get_option( 'edukarsa_sidebar_tampil_html', 0 ) == 1 ) :
<?php
if ( get_option( 'edukarsa_sidebar_tampil_html', 0 ) == 1 ) :
$html_content = get_option( 'edukarsa_sidebar_html_content' );
if ( ! empty( $html_content ) ) :
$html_title = get_option( 'edukarsa_sidebar_html_title' );
@@ -48,12 +41,11 @@
<?php echo do_shortcode( wp_specialchars_decode( $html_content ) ); ?>
</div>
</div>
<?php
<?php
endif;
endif;
endif;
?>
<!-- 4. Berita Terkini Dinamis -->
<?php if ( get_option( 'edukarsa_sidebar_tampil_recent', 1 ) == 1 ) : ?>
<div class="card-style sidebar-widget">
<h3 class="sidebar-widget-title"><?php echo esc_html( get_option( 'edukarsa_sidebar_recent_title', 'Warta Terkini' ) ); ?></h3>
@@ -65,7 +57,6 @@
'posts_per_page' => $count,
'post__not_in' => array( get_the_ID() )
) );
if ( $recent_query->have_posts() ) :
while ( $recent_query->have_posts() ) : $recent_query->the_post();
?>
@@ -76,7 +67,7 @@
</a>
<?php endif; ?>
<div class="sidebar-recent-info">
<span class="sidebar-recent-date">📅 <?php echo get_the_date( 'd M Y' ); ?></span>
<span class="sidebar-recent-date">&#128197; <?php echo get_the_date( 'd M Y' ); ?></span>
<h4 class="sidebar-recent-title">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</h4>
@@ -86,44 +77,56 @@
endwhile;
wp_reset_postdata();
else :
echo '<p style="font-size:13px; color:var(--text-muted); margin:0;">Belum ada artikel lainnya.</p>';
echo '<p style="font-size:13px; color:var(--text-muted); margin:0;">' . esc_html__( 'Belum ada artikel lainnya.', 'edukarsa' ) . '</p>';
endif;
?>
</div>
</div>
<?php endif; ?>
<!-- 5. Daftar Kategori Pilihan -->
<?php if ( get_option( 'edukarsa_sidebar_tampil_cats', 1 ) == 1 ) : ?>
<div class="card-style sidebar-widget">
<h3 class="sidebar-widget-title"><?php echo esc_html( get_option( 'edukarsa_sidebar_cats_title', 'Kategori Pilihan' ) ); ?></h3>
<ul class="sidebar-category-list">
<?php
$categories = get_categories( array( 'hide_empty' => true ) );
foreach ( $categories as $category ) :
?>
<li>
<a href="<?php echo esc_url( get_category_link( $category->term_id ) ); ?>" class="sidebar-cat-link">
<span><?php echo esc_html( $category->name ); ?></span>
<span class="sidebar-cat-count"><?php echo esc_html( $category->count ); ?></span>
</a>
</li>
<?php endforeach; ?>
$cat_limit = intval( get_option( 'edukarsa_sidebar_cats_count', 10 ) );
$cat_args = array(
'hide_empty' => true,
'orderby' => 'count',
'order' => 'DESC',
);
if ( $cat_limit > 0 ) {
$cat_args['number'] = $cat_limit;
}
$categories = get_categories( $cat_args );
if ( ! empty( $categories ) ) :
foreach ( $categories as $category ) :
?>
<li>
<a href="<?php echo esc_url( get_category_link( $category->term_id ) ); ?>" class="sidebar-cat-link">
<span><?php echo esc_html( $category->name ); ?></span>
<span class="sidebar-cat-count"><?php echo esc_html( $category->count ); ?></span>
</a>
</li>
<?php
endforeach;
else :
echo '<li style="font-size:13px; color:var(--text-muted);">' . esc_html__( 'Belum ada kategori.', 'edukarsa' ) . '</li>';
endif;
?>
</ul>
</div>
<?php endif; ?>
<!-- 6. Banner Poster Sidebar -->
<?php
<?php
$banner_img = get_option( 'edukarsa_sidebar_banner_img' );
if ( ! empty( $banner_img ) ) :
$banner_url = get_option( 'edukarsa_sidebar_banner_url', '#' );
?>
<div class="card-style sidebar-widget sidebar-banner-box" style="padding: 10px; overflow: hidden;">
<a href="<?php echo esc_url( $banner_url ); ?>" target="_blank" rel="noopener">
<img src="<?php echo esc_url( $banner_img ); ?>" alt="Banner Pengumuman" style="width: 100%; height: auto; border-radius: 8px; display: block;">
<img src="<?php echo esc_url( $banner_img ); ?>" alt="<?php esc_attr_e( 'Banner Pengumuman', 'edukarsa' ); ?>" style="width: 100%; height: auto; border-radius: 8px; display: block;">
</a>
</div>
<?php endif; ?>
</aside>
+25 -64
View File
@@ -1,23 +1,13 @@
<?php defined( 'ABSPATH' ) || exit; ?>
<?php
/**
* Template Baca Artikel Penuh (Single Post) EduKarsa
* Dilengkapi Breadcrumbs, Intra-post Paging, Inter-post Paging, dan Native Social Share
*/
get_header();
defined( 'ABSPATH' ) || exit;
get_header();
?>
<main id="primary" class="site-main" style="padding: 45px 0 70px; background-color: #f8fafc; min-height: 75vh;">
<div class="container single-layout-wrapper">
<!-- KOLOM KONTEN UTAMA -->
<div class="single-content-column">
<?php while ( have_posts() ) : the_post(); ?>
<!-- BREADCRUMBS NATIVE -->
<nav class="edukarsa-breadcrumbs" aria-label="Breadcrumb">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">Beranda</a>
<nav class="edukarsa-breadcrumbs" aria-label="<?php esc_attr_e( 'Breadcrumb', 'edukarsa' ); ?>">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php esc_html_e( 'Beranda', 'edukarsa' ); ?></a>
<span class="bc-sep">/</span>
<?php
$categories = get_the_category();
@@ -28,27 +18,18 @@ get_header();
?>
<span class="bc-current"><?php the_title(); ?></span>
</nav>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'card-style single-article-card' ); ?>>
<!-- HEADER ARTIKEL -->
<header class="entry-header">
<?php if ( ! empty( $categories ) ) : ?>
<span class="badge-title"><?php echo esc_html( $categories[0]->name ); ?></span>
<?php endif; ?>
<h1 class="single-article-title">
<?php the_title(); ?>
</h1>
<h1 class="single-article-title"><?php the_title(); ?></h1>
<div class="single-meta-bar">
<span>📅 <?php echo get_the_date( 'l, d F Y' ); ?></span>
<span>👤 <?php the_author(); ?></span>
<span>⏱️ <?php echo ceil( str_word_count( strip_tags( get_the_content() ) ) / 200 ); ?> Menit Baca</span>
<span>&#128197; <?php echo get_the_date( 'l, d F Y' ); ?></span>
<span>&#128100; <?php the_author(); ?></span>
<span>&#9201; <?php echo ceil( str_word_count( strip_tags( get_the_content() ) ) / 200 ); ?> Menit Baca</span>
</div>
</header>
<!-- GAMBAR UTAMA DENGAN CAPTION -->
<?php if ( has_post_thumbnail() ) : ?>
<div class="single-featured-image">
<?php the_post_thumbnail( 'full' ); ?>
@@ -57,13 +38,9 @@ get_header();
<?php endif; ?>
</div>
<?php endif; ?>
<!-- ISI ARTIKEL UTAMA -->
<div class="entry-content">
<?php
the_content();
// 1. INTRA-POST PAGINATION (Jika artikel dipecah dengan tag <!--nextpage-->)
wp_link_pages( array(
'before' => '<div class="intra-post-pagination"><span class="page-links-title">' . __( 'Halaman Artikel:', 'edukarsa' ) . '</span>',
'after' => '</div>',
@@ -72,75 +49,59 @@ get_header();
) );
?>
</div>
<!-- TAGS & BAGIKAN ARTIKEL -->
<?php if ( has_tag() ) : ?>
<div class="single-article-footer">
<div class="single-tags-list">
<?php the_tags( '<span class="tag-label">Topik Terkait:</span> ', ' ', '' ); ?>
</div>
<!-- Native Share Buttons (No Plugin) -->
<div class="single-share-bar">
<span class="share-label">Bagikan:</span>
<?php
$share_url = rawurlencode( get_permalink() );
$share_title = rawurlencode( get_the_title() );
?>
<a href="https://wa.me/?text=<?php echo $share_title . '%20' . $share_url; ?>" target="_blank" rel="noopener" class="share-btn share-wa" title="Bagikan ke WhatsApp">WhatsApp</a>
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $share_url; ?>" target="_blank" rel="noopener" class="share-btn share-fb" title="Bagikan ke Facebook">Facebook</a>
<a href="https://twitter.com/intent/tweet?text=<?php echo $share_title; ?>&url=<?php echo $share_url; ?>" target="_blank" rel="noopener" class="share-btn share-tw" title="Bagikan ke X">X / Twitter</a>
<button type="button" class="share-btn share-copy" onclick="navigator.clipboard.writeText('<?php echo esc_js( get_permalink() ); ?>'); alert('Tautan artikel berhasil disalin!');">Salin Tautan</button>
<?php the_tags( '<span class="tag-label">' . esc_html__( 'Topik Terkait:', 'edukarsa' ) . '</span> ', ' ', '' ); ?>
</div>
</div>
<?php endif; ?>
<?php edukarsa_social_share(); ?>
</article>
<!-- 2. INTER-POST PAGINATION (Navigasi Berita Sebelumnya & Selanjutnya) -->
<nav class="inter-post-nav">
<?php
$prev_post = get_previous_post();
$next_post = get_next_post();
?>
<div class="nav-box nav-box-prev card-style <?php echo empty($prev_post) ? 'disabled' : ''; ?>">
<?php if ( ! empty( $prev_post ) ) : ?>
<a href="<?php echo esc_url( get_permalink( $prev_post->ID ) ); ?>" class="nav-box-link">
<span class="nav-direction">&laquo; Artikel Sebelumnya</span>
<span class="nav-direction">&laquo; <?php esc_html_e( 'Artikel Sebelumnya', 'edukarsa' ); ?></span>
<h4 class="nav-post-title"><?php echo esc_html( wp_trim_words( $prev_post->post_title, 9, '...' ) ); ?></h4>
</a>
<?php else : ?>
<span class="nav-direction">&laquo; Paling Awal</span>
<h4 class="nav-post-title" style="color:#94a3b8;">Tidak ada artikel sebelumnya</h4>
<span class="nav-direction">&laquo; <?php esc_html_e( 'Paling Awal', 'edukarsa' ); ?></span>
<h4 class="nav-post-title" style="color:#94a3b8;"><?php esc_html_e( 'Tidak ada artikel sebelumnya', 'edukarsa' ); ?></h4>
<?php endif; ?>
</div>
<div class="nav-box nav-box-next card-style <?php echo empty($next_post) ? 'disabled' : ''; ?>">
<?php if ( ! empty( $next_post ) ) : ?>
<a href="<?php echo esc_url( get_permalink( $next_post->ID ) ); ?>" class="nav-box-link text-right">
<span class="nav-direction">Artikel Selanjutnya &raquo;</span>
<span class="nav-direction"><?php esc_html_e( 'Artikel Selanjutnya', 'edukarsa' ); ?> &raquo;</span>
<h4 class="nav-post-title"><?php echo esc_html( wp_trim_words( $next_post->post_title, 9, '...' ) ); ?></h4>
</a>
<?php else : ?>
<div class="text-right">
<span class="nav-direction">Paling Akhir &raquo;</span>
<h4 class="nav-post-title" style="color:#94a3b8;">Tidak ada artikel selanjutnya</h4>
<span class="nav-direction"><?php esc_html_e( 'Paling Akhir', 'edukarsa' ); ?> &raquo;</span>
<h4 class="nav-post-title" style="color:#94a3b8;"><?php esc_html_e( 'Tidak ada artikel selanjutnya', 'edukarsa' ); ?></h4>
</div>
<?php endif; ?>
</div>
</nav>
<?php
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?>
<?php endwhile; ?>
</div>
<!-- KOLOM SIDEBAR DINAMIS -->
<div class="single-sidebar-column">
<?php get_sidebar(); ?>
</div>
</div>
</main>
<?php
get_footer();
?>
<?php
get_footer();
+554 -312
View File
File diff suppressed because it is too large Load Diff