75 lines
3.1 KiB
PHP
75 lines
3.1 KiB
PHP
<?php
|
|
defined( 'ABSPATH' ) || exit;
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html <?php language_attributes(); ?>>
|
|
<head>
|
|
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<?php wp_head(); ?>
|
|
</head>
|
|
<body <?php body_class(); ?>>
|
|
<?php
|
|
if ( function_exists( 'wp_body_open' ) ) {
|
|
wp_body_open();
|
|
} else {
|
|
do_action( 'wp_body_open' );
|
|
}
|
|
?>
|
|
|
|
<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>
|
|
<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>
|