get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->get_section( 'colors' )->panel = 'theme_colors_panel'; $wp_customize->get_section( 'colors' )->title = esc_html__('Color Options','blogexpress'); $wp_customize->get_section( 'title_tagline' )->panel = 'theme_general_settings'; $wp_customize->get_section( 'header_image' )->panel = 'theme_general_settings'; $wp_customize->get_section( 'background_image' )->panel = 'theme_general_settings'; if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.header-titles .custom-logo-name', 'render_callback' => 'blogexpress_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'blogexpress_customize_partial_blogdescription', ) ); } // Theme Options Panel. $wp_customize->add_panel( 'theme_option_panel', array( 'title' => esc_html__( 'Theme Options', 'blogexpress' ), 'priority' => 150, 'capability' => 'edit_theme_options', ) ); $wp_customize->add_panel( 'theme_general_settings', array( 'title' => esc_html__( 'General Settings', 'blogexpress' ), 'priority' => 10, 'capability' => 'edit_theme_options', ) ); $wp_customize->add_panel( 'theme_colors_panel', array( 'title' => esc_html__( 'Color Settings', 'blogexpress' ), 'priority' => 15, 'capability' => 'edit_theme_options', ) ); // Theme Options Panel. $wp_customize->add_panel( 'theme_footer_option_panel', array( 'title' => esc_html__( 'Footer Setting', 'blogexpress' ), 'priority' => 150, 'capability' => 'edit_theme_options', ) ); // Template Options $wp_customize->add_panel( 'theme_home_pannel', array( 'title' => esc_html__( 'Frontpage Settings', 'blogexpress' ), 'priority' => 150, 'capability' => 'edit_theme_options', ) ); // Register custom section types. $wp_customize->register_section_type( 'BlogExpress_Customize_Section_Upsell' ); // Register sections. $wp_customize->add_section( new BlogExpress_Customize_Section_Upsell( $wp_customize, 'theme_upsell', array( 'title' => esc_html__( 'BlogExpress Pro', 'blogexpress' ), 'pro_text' => esc_html__( 'Upgrade To Pro', 'blogexpress' ), 'pro_url' => esc_url('https://www.themeinwp.com/theme/blogexpress-pro/'), 'priority' => 1, ) ) ); $blogexpress_defaults = blogexpress_get_default_theme_options(); $wp_customize->add_setting( 'header_image_size', array( 'default' => $blogexpress_defaults['header_image_size'], 'sanitize_callback' => 'blogexpress_sanitize_select', ) ); $wp_customize->add_control( 'header_image_size', array( 'label' => __( 'Header Image Size', 'blogexpress' ), 'section' => 'header_image', 'type' => 'select', 'choices' => array( 'header-default-height' => __( 'Default', 'blogexpress' ), 'header-small-height' => __( 'Small', 'blogexpress' ), 'header-medium-height' => __( 'Medium', 'blogexpress' ), 'header-large-height' => __( 'Large', 'blogexpress' ), ), ) ); } endif; add_action( 'customize_register', 'blogexpress_customize_register' ); /** * Customizer Enqueue scripts and styles. */ if (!function_exists('blogexpress_customizer_scripts')) : function blogexpress_customizer_scripts(){ wp_enqueue_script('jquery-ui-button'); wp_enqueue_style('blogexpress-customizer', get_template_directory_uri() . '/assets/lib/custom/css/customizer.css'); wp_enqueue_script('blogexpress-customizer', get_template_directory_uri() . '/assets/lib/custom/js/customizer.js', array('jquery','customize-controls'), '', 1); $ajax_nonce = wp_create_nonce('blogexpress_ajax_nonce'); wp_localize_script( 'blogexpress-customizer', 'blogexpress_customizer', array( 'ajax_url' => esc_url( admin_url( 'admin-ajax.php' ) ), 'ajax_nonce' => $ajax_nonce, ) ); } endif; add_action('customize_controls_enqueue_scripts', 'blogexpress_customizer_scripts'); add_action('customize_controls_init', 'blogexpress_customizer_scripts'); function blogexpress_customize_preview_js() { wp_enqueue_script( 'blogexpress-customizer-preview', get_template_directory_uri() . '/assets/lib/custom/js/customizer-preview.js', array( 'customize-preview' ), '20151215', true ); } add_action( 'customize_preview_init', 'blogexpress_customize_preview_js' ); /** * Render the site title for the selective refresh partial. * * @return void */ if (!function_exists('blogexpress_customize_partial_blogname')) : function blogexpress_customize_partial_blogname() { bloginfo( 'name' ); } endif; /** * Render the site tagline for the selective refresh partial. * * @return void */ if (!function_exists('blogexpress_customize_partial_blogdescription')) : function blogexpress_customize_partial_blogdescription() { bloginfo( 'description' ); } endif;