get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; } } add_action( 'customize_register', 'clearthoughts_customize_register' ); if ( ! function_exists( 'clearthoughts_theme_customize_register' ) ) { /** * Register individual settings through customizer's API. * * @param WP_Customize_Manager $wp_customize Customizer reference. */ function clearthoughts_theme_customize_register( $wp_customize ) { // Theme layout settings. $wp_customize->add_section( 'clearthoughts_theme_layout_options', array( 'title' => __( 'Theme Layout Settings', 'clearthoughts' ), 'capability' => 'edit_theme_options', 'description' => __( 'Container width and sidebar defaults', 'clearthoughts' ), 'priority' => 160, ) ); $wp_customize->add_setting( 'clearthoughts_container_type', array( 'default' => 'container', 'type' => 'theme_mod', 'sanitize_callback' => 'esc_textarea', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'container_type', array( 'label' => __( 'Container Width', 'clearthoughts' ), 'description' => __( "Choose between Bootstrap's container and container-fluid", 'clearthoughts' ), 'section' => 'clearthoughts_theme_layout_options', 'settings' => 'clearthoughts_container_type', 'type' => 'select', 'choices' => array( 'container' => __( 'Fixed width container', 'clearthoughts' ), 'container-fluid' => __( 'Full width container', 'clearthoughts' ), ), 'priority' => '10', ) ) ); //-- NAV BACKGROUND $wp_customize->add_setting( 'nav_bg_color', array( 'default' => '#fff', 'type' => 'theme_mod', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_section( 'clearthoughts_nav_bg_color', array( 'title' => __( 'Navigation Background', 'clearthoughts' ), 'capability' => 'edit_theme_options', 'description' => __( 'Background Color for top Navigation', 'clearthoughts' ), 'priority' => 70, ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'clearthoughts_nav_control', array( 'label' => __( 'Background Color', 'clearthoughts' ), 'description' => __( "Choose a background color", 'clearthoughts' ), 'section' => 'clearthoughts_nav_bg_color', 'settings' => 'nav_bg_color', ) ) ); //-- HEADER & FOOTER BG COLORS $wp_customize->add_setting( 'hf_bg_color', array( 'default' => '#e9ecef', 'type' => 'theme_mod', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_section( 'clearthoughts_hf_bg_color', array( 'title' => __( 'Header & Footer Widgets Background', 'clearthoughts' ), 'capability' => 'edit_theme_options', 'description' => __( 'Background Color for Header & Footer', 'clearthoughts' ), 'priority' => 70, ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'clearthoughts_hf_color_control', array( 'label' => __( 'Background Color', 'clearthoughts' ), 'description' => __( "Choose a background color", 'clearthoughts' ), 'section' => 'clearthoughts_hf_bg_color', 'settings' => 'hf_bg_color', ) ) ); //-- HEADING & META COLORS $wp_customize->add_setting( 'meta_color', array( 'default' => '#181818', 'type' => 'theme_mod', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'clearthoughts_link_color_control', array( 'label' => __( 'Secondary Color', 'clearthoughts' ), 'description' => __( "Secondary font color for titles, meta info and links.", 'clearthoughts' ), 'section' => 'colors', 'settings' => 'meta_color', ) ) ); //-- BODY FONT COLORS $wp_customize->add_setting( 'body_color', array( 'default' => '#404040', 'type' => 'theme_mod', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'clearthoughts_body_color_control', array( 'label' => __( 'Body Font Color', 'clearthoughts' ), 'description' => __( "Choose a color for main body content", 'clearthoughts' ), 'section' => 'colors', 'settings' => 'body_color', ) ) ); //-- LINK COLOR, SINGLE $wp_customize->add_setting( 'single_link_color', array( 'default' => '#007bff',//Default Bootstrap link color 'type' => 'theme_mod', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'clearthoughts_single_link_color_control', array( 'label' => __( 'Single Link Color', 'clearthoughts' ), 'description' => __( "Choose a color for content links", 'clearthoughts' ), 'section' => 'colors', 'settings' => 'single_link_color', ) ) ); } } // endif function_exists( 'clearthoughts_theme_customize_register' ). add_action( 'customize_register', 'clearthoughts_theme_customize_register' ); /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ if ( ! function_exists( 'clearthoughts_customize_preview_js' ) ) { /** * Setup JS integration for live previewing. */ function clearthoughts_customize_preview_js() { wp_enqueue_script( 'clearthoughts_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true ); } } //CUSTOM COLOR OUTPUT, CSS function clearthoughts_customize_css() { ?>