get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->get_setting( 'background_color' )->transport = 'postMessage'; /** * -------------------------- * Customization - Main color * -------------------------- */ $wp_customize->add_section( 'colors', array( 'title' => __( 'Colors', 'anisbd' ), 'priority' => 40, ) ); /* Header Background */ $wp_customize->add_setting( 'header_color', array( 'default' => '#FAFAFA', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'headercolor', array( 'label' => __( 'Header background', 'anisbd' ), 'section' => 'colors', 'settings' => 'header_color', 'priority' => 10, ) )); /* Top Navbar link hover background */ $wp_customize->add_setting( 'topnavbghover_color', array( 'default' => '#EDEDED', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'topnavbghovercolor', array( 'label' => __( 'Top menu Hover background', 'anisbd' ), 'section' => 'colors', 'settings' => 'topnavbghover_color', 'priority' => 10, ) )); /* Top Navbar text hover background */ $wp_customize->add_setting( 'topnavtxthover_color', array( 'default' => '#444444', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'topnavtxthovercolor', array( 'label' => __( 'Top menu Hover Text color', 'anisbd' ), 'section' => 'colors', 'settings' => 'topnavtxthover_color', 'priority' => 10, ) )); /* Top Navbar link color */ $wp_customize->add_setting( 'topnavcol_color', array( 'default' => '#444444', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'topnavcolcolor', array( 'label' => __( 'Top menu Link color', 'anisbd' ), 'section' => 'colors', 'settings' => 'topnavcol_color', 'priority' => 10, ) )); /* Sticky Background */ $wp_customize->add_setting( 'sticky_color', array( 'default' => '#FAFAFA', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'stickycolor', array( 'label' => __( 'Sticky Background', 'anisbd' ), 'section' => 'colors', 'settings' => 'sticky_color', 'priority' => 10, ) )); /* Main post color */ $wp_customize->add_setting( 'main_post', array( 'default' => '#FAFAFA', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mainpost', array( 'label' => __( 'Post Area Background', 'anisbd' ), 'section' => 'colors', 'settings' => 'main_post', 'priority' => 10, ) )); /* Sidebar Background */ $wp_customize->add_setting( 'sidebar_color', array( 'default' => '#FAFAFA', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sidebarcolor', array( 'label' => __( 'Sidebar background', 'anisbd' ), 'section' => 'colors', 'settings' => 'sidebar_color', 'priority' => 10, ) )); /* Text color */ $wp_customize->add_setting( 'post_txt_color', array( 'default' => '#444444', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'posttxtcolor', array( 'label' => __( 'Text color', 'anisbd' ), 'section' => 'colors', 'settings' => 'post_txt_color', 'priority' => 10, ) )); /* Link color */ $wp_customize->add_setting( 'post_lnk_color', array( 'default' => '#333333', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'postlnkcolor', array( 'label' => __( 'Link color', 'anisbd' ), 'section' => 'colors', 'settings' => 'post_lnk_color', 'priority' => 10, ) )); /* Footer Background */ $wp_customize->add_setting( 'footer_color', array( 'default' => '#EDEDED', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footercolor', array( 'label' => __( 'Footer background', 'anisbd' ), 'section' => 'colors', 'settings' => 'footer_color', 'priority' => 10, ) )); /* Footer Text color */ $wp_customize->add_setting( 'foot_txt_color', array( 'default' => '#444444', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'foottxtcolor', array( 'label' => __( 'Footer Text color', 'anisbd' ), 'section' => 'colors', 'settings' => 'foot_txt_color', 'priority' => 10, ) )); /** * ---------------------------- * Customization - Header Image * ---------------------------- */ $wp_customize->add_section( 'header_image', array( 'title' => __( 'Header Image', 'anisbd' ), 'theme_supports' => 'custom-header', 'priority' => 60, )); /* Header image */ $wp_customize->add_setting( 'head_image', array( 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', ) ); } /* Change the value */ add_action( 'wp_head' , 'my_dynamic_css' ); function my_dynamic_css() { ?>