get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; } add_action( 'customize_register', 'cafefaucher_customize_register' ); /** * Customize Logo and tagline * * @since Cafe Faucher 1.0 */ // Customize Logo instead of Text function cafefaucher_theme_customizer( $wp_customize ) { $wp_customize->add_section( 'cafefaucher_logo_section' , array( 'title' => __( 'Logo', 'cafefaucher' ), 'priority' => 30, 'description' => 'Upload a logo to replace the default site name and description in the header', )); $wp_customize->add_setting( 'cafefaucher_logo', 'sanitize_callback' == 'esc_url_raw' ); $wp_customize->add_control('cafefaucher_logo', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'type' => 'theme_mod', )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'cafefaucher_logo', array( 'label' => __( 'Logo', 'cafefaucher' ), 'section' => 'cafefaucher_logo_section', 'settings' => 'cafefaucher_logo', 'sanitize_callback' => 'esc_url_raw', ))); // Create header background color setting $wp_customize->add_setting( 'header_color', array( 'default' => '#c2d6e2', 'type' => 'theme_mod', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', )); // Add header background color control $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_color', array( 'label' => __( 'Header Background Color', 'cafefaucher' ), 'section' => 'colors', ))); // Create page background color setting $wp_customize->add_setting( 'background_color', array( 'default' => '#e3e7ea', 'type' => 'theme_mod', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', )); // Add background color control $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'background_color', array( 'label' => __( 'Page Background Color', 'cafefaucher' ), 'section' => 'colors', 'settings' => 'background_color', ))); //adding setting for footer background $wp_customize->add_setting('footer_color', array( 'default' => '#396B89', 'sanitize_callback' == 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_color', array( 'label' => 'Footer Background Color', 'section' => 'colors', 'settings' => 'footer_color', 'sanitize_callback' => 'esc_url_raw', ))); } add_action( 'customize_register', 'cafefaucher_theme_customizer' ); /** * Customize Footer Copyright & Powered By text * * @since Cafe Faucher 1.0 */ function cafe_faucher_footer_customizer($wp_customize){ $wp_customize->add_section( 'footer_copyright_section' , array( 'title' => __( 'Footer', 'cafefaucher' ), 'priority' => 80, 'description' => 'Add your Copyright & Powered By text here', ) ); $wp_customize->add_setting( 'footer_copyright_section', 'sanitize_callback' == 'esc_url_raw' ); $wp_customize->add_control('footer_copyright_section', array( 'label' => 'Footer Text', 'section' => 'footer_copyright_section', 'type' => 'textarea', 'sanitize_callback' => 'esc_url_raw', )); } add_action('customize_register', 'cafe_faucher_footer_customizer'); /** * Inject Customizer CSS when appropriate */ function cafefaucher_customizer_css() { $header_color = get_theme_mod('header_color'); ?>