Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5213e39b24 | ||
|
|
a6e9b2a196 | ||
|
|
817f7cd0c3 | ||
|
|
1a28bd7c65 | ||
|
|
71d88b8753 | ||
|
|
27799d11be | ||
|
|
d36ca2d58d | ||
|
|
b0b6883f37 | ||
|
|
8804243b4f |
+14
-24
@@ -1,28 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* File Loader / Router Tema EduKarsa
|
||||
* Seluruh logika modular ditempatkan di folder inc/
|
||||
* File ini berfungsi sebagai 'Router/Loader'.
|
||||
* Seluruh fungsionalitas diisolasi ke dalam sub-berkas direktori inc/.
|
||||
*/
|
||||
defined('ABSPATH') || exit; // Hardened Security Native
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
// 1. Memuat Modul Keamanan & Hardening Native
|
||||
require_once get_template_directory() . '/inc/security.php';
|
||||
|
||||
// 2. Memuat Modul Kamus Dinamis Dashboard (i18n)
|
||||
require_once get_template_directory() . '/inc/i18n.php';
|
||||
|
||||
// 3. Memuat Pengaturan Dasar Tema & Aset
|
||||
require_once get_template_directory() . '/inc/setup.php';
|
||||
|
||||
// 4. Memuat Custom Post Type Native
|
||||
require_once get_template_directory() . '/inc/cpt-slider.php';
|
||||
|
||||
// 5. Memuat Panel Menu EduKarsa & Settings API
|
||||
require_once get_template_directory() . '/inc/admin-menu.php';
|
||||
|
||||
// 6. Memuat Native SEO & Structured Data (JSON-LD)
|
||||
require_once get_template_directory() . '/inc/seo.php';
|
||||
|
||||
// 7. Memuat Modul Pop-up Flyer & Pengumuman Modal
|
||||
require_once get_template_directory() . '/inc/popup.php';
|
||||
// Auto-load secara dinamis seluruh file PHP di dalam folder inc/
|
||||
// Ini akan secara otomatis memulihkan modul i18n, security, popup, dan gallery Anda.
|
||||
$inc_dir = get_template_directory() . '/inc/';
|
||||
if ( is_dir( $inc_dir ) ) {
|
||||
$inc_files = glob( $inc_dir . '*.php' );
|
||||
if ( $inc_files ) {
|
||||
foreach ( $inc_files as $file ) {
|
||||
require_once $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+24
-74
@@ -1,16 +1,16 @@
|
||||
<?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' );
|
||||
|
||||
// Pastikan tema mendukung excerpt (kutipan) untuk CPT
|
||||
add_post_type_support( 'page', 'excerpt' );
|
||||
|
||||
register_nav_menus( array(
|
||||
'menu-utama' => __( 'Menu Utama', 'edukarsa' ),
|
||||
@@ -21,85 +21,35 @@ add_action( 'after_setup_theme', 'edukarsa_setup' );
|
||||
|
||||
// 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";
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
$deps = array();
|
||||
if ( ! empty( $font_url ) ) {
|
||||
wp_enqueue_style( 'edukarsa-dynamic-font', $font_url, array(), null );
|
||||
$deps[] = 'edukarsa-dynamic-font';
|
||||
}
|
||||
|
||||
// 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 );
|
||||
// Memaksa path absolut langsung ke folder tema dengan Cache Busting time()
|
||||
wp_enqueue_style(
|
||||
'edukarsa-style',
|
||||
get_template_directory_uri() . '/style.css',
|
||||
array(),
|
||||
time(),
|
||||
'all'
|
||||
);
|
||||
}
|
||||
add_action( 'wp_enqueue_scripts', 'edukarsa_scripts' );
|
||||
|
||||
// 3. MEMUAT JAVASCRIPT UNTUK MEDIA UPLOADER (DASHBOARD)
|
||||
function edukarsa_admin_scripts( $hook ) {
|
||||
// Memastikan skrip uploader dipanggil di halaman pengaturan Edukarsa
|
||||
if ( strpos( $hook, 'edukarsa' ) !== false ) {
|
||||
wp_enqueue_media();
|
||||
}
|
||||
}
|
||||
add_action( 'admin_enqueue_scripts', 'edukarsa_admin_scripts' );
|
||||
|
||||
// 4. REGISTRASI AREA WIDGET SIDEBAR
|
||||
function edukarsa_widgets_init() {
|
||||
register_sidebar( array(
|
||||
'name' => __( 'Sidebar Artikel', 'edukarsa' ),
|
||||
'id' => 'sidebar-artikel',
|
||||
'description' => __( 'Area widget untuk halaman single berita/artikel.', '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>',
|
||||
) );
|
||||
// 4. REDIRECT SETELAH AKTIVASI TEMA
|
||||
|
||||
// 4. REDIRECT AMAN SETELAH AKTIVASI TEMA
|
||||
function edukarsa_activation_redirect() {
|
||||
global $pagenow;
|
||||
if ( 'themes.php' === $pagenow && isset( $_GET['activated'] ) ) {
|
||||
// Redirect yang aman, dipanggil setelah seluruh menu dan hak akses WordPress siap
|
||||
wp_safe_redirect( admin_url( 'admin.php?page=edukarsa_settings' ) );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
add_action( 'widgets_init', 'edukarsa_widgets_init' );
|
||||
add_action( 'admin_init', 'edukarsa_activation_redirect' );
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 262 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 927 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 901 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 973 KiB |
@@ -3,8 +3,9 @@ Theme Name: EduKarsa
|
||||
Theme URI: https://edukarsa.masbudi.my.id
|
||||
Author: masbudikusuma
|
||||
Author URI: https://masbudi.my.id
|
||||
Description: Tema WordPress profesional untuk sekolah dan kampus (Gaya Modern Card Layout).
|
||||
Version: 1.1.4
|
||||
Description: Tema WordPress profesional untuk sekolah dan kampus (Gaya Modern Card Layout).<br><br><strong>Fitur Unggulan Tema:</strong><ul><li><strong>Zero Plugin Dependency:</strong> Berjalan optimal tanpa ketergantungan plugin pihak ketiga (tanpa ACF, Elementor, atau plugin galeri).</li><li><strong>Modular Architecture:</strong> Berkas functions.php berfungsi murni sebagai pemanggil (router), seluruh fungsionalitas diisolasi di folder inc/.</li><li><strong>Hardened Security Native:</strong> Pengecekan eksekusi langsung, HTTP security headers, penonaktifan author enumeration, dan proteksi REST API.</li><li><strong>WCAG 2.1 Accessibility:</strong> Widget aksesibilitas bawaan dengan Web Speech API (suara baca audio) dan kontras tinggi.</li><li><strong>Multilingual Terpadu:</strong> Penerjemah instan sisi depan (ID, EN, AR, ZH, JA) serta panel admin dwibahasa.</li><li><strong>SEO & Structured Data:</strong> Skema data terstruktur JSON-LD native untuk visibilitas mesin pencari.</li></ul>
|
||||
Version: 1.1.5
|
||||
Tags: pendidikan, sekolah, universitas, custom-menu, custom-logo, modern-layout, responsive-layout, translation-ready, accessibility-ready, seo-friendly
|
||||
*/
|
||||
|
||||
:root {
|
||||
|
||||
Reference in New Issue
Block a user