110,
'width' => 400,
'flex-height' => true,
'flex-width' => true,
) );
add_theme_support( 'custom-header', array(
'default-image' => '',
'width' => 1920,
'height' => 800,
'flex-height' => true,
) );
add_theme_support( 'custom-background', array(
'default-color' => 'ffffff',
) );
register_nav_menus( array(
'menu-utama' => esc_html__( 'Menu Navigasi Utama', 'edukarsa' ),
'menu-footer' => esc_html__( 'Menu Tautan Footer', 'edukarsa' ),
) );
}
}
add_action( 'after_setup_theme', 'edukarsa_theme_setup' );
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' => '
' . esc_html__( 'Pendaftaran Mahasiswa / Siswa Baru Telah Dibuka!', 'edukarsa' ) . '
',
'categories' => array( 'featured' ),
)
);
}
}
add_action( 'init', 'edukarsa_register_block_components' );
function edukarsa_register_sidebars() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar Utama', 'edukarsa' ),
'id' => 'sidebar-utama',
'description' => esc_html__( 'Area widget untuk bilah samping postingan dan halaman.', 'edukarsa' ),
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'edukarsa_register_sidebars' );
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 );
}
// Memuat API Google Translate dengan dependensi ke edukarsa-global-js
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' );