get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', 'render_callback' => 'ajima_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'ajima_customize_partial_blogdescription', ) ); } /*Get default values to set while building customizer elements*/ $default_options = ajima_get_default_customizer_values(); /* Header Background Color*/ $wp_customize->add_setting( 'ajima_options[header_bg_color]', array( 'default' => $default_options['header_bg_color'], 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ajima_options[header_bg_color]', array( 'label' => __('Header Background Color', 'ajima'), 'section' => 'colors', 'type' => 'color', 'priority' => 1, ) ) ); /*Load customizer options.*/ require_once get_template_directory() . '/inc/customizer/theme-options/page-loading-add.php'; require_once get_template_directory() . '/inc/customizer/theme-options/preloader.php'; require_once get_template_directory() . '/inc/customizer/theme-options/night-mode.php'; require_once get_template_directory() . '/inc/customizer/theme-options/topbar.php'; require_once get_template_directory() . '/inc/customizer/theme-options/header.php'; require_once get_template_directory() . '/inc/customizer/theme-options/front-page-banner.php'; require_once get_template_directory() . '/inc/customizer/theme-options/front-page-popular.php'; require_once get_template_directory() . '/inc/customizer/theme-options/front-page.php'; require_once get_template_directory() . '/inc/customizer/theme-options/general-setting.php'; require_once get_template_directory() . '/inc/customizer/theme-options/archive.php'; require_once get_template_directory() . '/inc/customizer/theme-options/read-time.php'; require_once get_template_directory() . '/inc/customizer/theme-options/single.php'; require_once get_template_directory() . '/inc/customizer/theme-options/pagination.php'; require_once get_template_directory() . '/inc/customizer/theme-options/footer-recommended.php'; require_once get_template_directory() . '/inc/customizer/theme-options/footer.php'; require_once get_template_directory() . '/inc/customizer/theme-options/theme-options.php'; // View Pro $wp_customize->add_section( 'pro__section', array( 'title' => '' . esc_html__( 'View PRO Version', 'ajima' ), 'priority' => 2, 'description' => sprintf( /* translators: %s: The view pro link. */ __( '

Need More? Go PRO

Take it to the next level. See the features below:

%s
', 'ajima' ), /* translators: %1$s: The view pro URL, %2$s: The view pro link text. */ sprintf( '%2$s', esc_url( ajima_get_pro_link() ), esc_html__( 'View Ajima PRO', 'ajima' ) ) ), ) ); $wp_customize->add_setting( 'ajima_style_view_pro_desc', array( 'default' => '', 'sanitize_callback' => '__return_true', ) ); $wp_customize->add_control( 'ajima_style_view_pro_desc', array( 'section' => 'pro__section', 'type' => 'hidden', ) ); } add_action( 'customize_register', 'ajima_customize_register' ); /** * Render the site title for the selective refresh partial. * * @return void */ function ajima_customize_partial_blogname() { bloginfo( 'name' ); } /** * Render the site tagline for the selective refresh partial. * * @return void */ function ajima_customize_partial_blogdescription() { bloginfo( 'description' ); } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function ajima_customize_preview_js() { wp_enqueue_script( 'ajima-customizer', get_template_directory_uri() . '/assets/js/customizer.js', array( 'customize-preview' ), aJiMA_S_VERSION, true ); } add_action( 'customize_preview_init', 'ajima_customize_preview_js' ); /** * Customizer control scripts and styles. * * @since 1.0.0 */ function ajima_customizer_control_scripts(){ wp_enqueue_style('ajima-customizer-css', get_template_directory_uri() . '/assets/css/customizer.css'); wp_enqueue_script('ajima-customizer-controls', get_template_directory_uri() . '/assets/js/customizer-admin.js', array('jquery', 'jquery-ui-sortable', 'customize-controls') ); } add_action('customize_controls_enqueue_scripts', 'ajima_customizer_control_scripts', 0); /** * Generate a link to the premium theme info page. */ function ajima_get_pro_link() { return 'https://www.themeinwp.com/theme/ajima-pro/'; }