get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; if ( isset( $_GET['resetmods'] ) ) { remove_theme_mods(); } /* Add a custom class for reset button */ class bizmo_Customize_Reset_Control extends WP_Customize_Control { public $type = 'reset_button'; public function render_content() { ?>
add_section( 'color_settings', array( 'title' => 'Color Scheme', 'priority' => 140, 'description' => __( 'Choose colors for your theme.', 'bizmo' ), ) );*/ /* Nav Color */ $wp_customize->add_setting( 'nav_color', array( 'default' => '#024959', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nav_color', array( 'label' => 'Nav/Top Bar Color', 'section' => 'colors', 'settings' => 'nav_color', 'priority' => 10, ) ) ); /* Header Color */ $wp_customize->add_setting( 'header_color', array( 'default' => '#037E8C', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_color', array( 'label' => 'Header Color', 'section' => 'colors', 'settings' => 'header_color', 'priority' => 20, ) ) ); /* Button/Link Color */ $wp_customize->add_setting( 'button_color', array( 'default' => '#F24C27', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'button_color', array( 'label' => 'Button/Link Color', 'section' => 'colors', 'settings' => 'button_color', 'priority' => 30, ) ) ); /* Footer Color */ $wp_customize->add_setting( 'footer_color', array( 'default' => '#404040', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_color', array( 'label' => 'Footer Color', 'section' => 'colors', 'settings' => 'footer_color', 'priority' => 40, ) ) ); }// END COLOR SETTINGS /* ================================================================== RESET CONTROL ================================================================== */ add_action('bizmo_add_to_customizer','bizmo_reset_customizer_options'); function bizmo_reset_customizer_options($wp_customize) { global $wp_customize; /* Reset Theme Mods */ $wp_customize->add_section( 'reset_settings', array( 'title' => 'Reset Theme Mods', 'priority' => 9998, ) ); $wp_customize->add_setting( 'reset_button', array( 'default' => '', 'sanitize_callback' => 'bizmo_reset_button' ) ); $wp_customize->add_control( new bizmo_Customize_Reset_Control( $wp_customize, 'reset_button', array( 'label' => 'Reset all theme mods made for this theme to their default values by clicking the button below.', 'section' => 'reset_settings', 'settings' => 'reset_button', 'priority' => 45, ) ) ); }// END RESET CONTROL /* ================================================================== SUPPORT TAB ================================================================== */ add_action('bizmo_add_to_customizer','bizmo_support_customizer_options'); function bizmo_support_customizer_options($wp_customize) { global $wp_customize; /* Support */ $wp_customize->add_section( 'support_settings', array( 'title' => 'Theme Support', 'priority' => 9999, ) ); $wp_customize->add_setting( 'support_tab', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( new bizmo_Customize_Support_Control( $wp_customize, 'support_tab', array( 'label' => 'Theme Support', 'section' => 'support_settings', 'settings' => 'support_tab', 'priority' => 1, ) ) ); }// END SUPPORT TAB /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function bizmo_customize_preview_js() { wp_enqueue_script( 'bizmo_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true ); } add_action( 'customize_preview_init', 'bizmo_customize_preview_js' ); /* ========================================================== Loads the custom styles from the Theme Customizer ========================================================== */ add_action( 'wp_head', 'bizmo_custom_style'); function bizmo_custom_style() { ?>