get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; if ( isset( $wp_customize->selective_reamaaaze ) ) { $wp_customize->selective_reamaaaze->add_partial( 'blogname', array( 'selector' => '.site-title a', 'render_callback' => 'amaaaze_customize_partial_blogname', ) ); $wp_customize->selective_reamaaaze->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'amaaaze_customize_partial_blogdescription', ) ); } // Customizer for color themes $wp_customize->add_section('amaaaze_standard_colors',array( 'title' => esc_html__('Standard Colors', 'amaaaze'), 'priority' => 30 , )); $wp_customize->add_setting('amaaaze_primary_color',array( 'default' => '#000000', 'transport' => 'reamaaaze', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_setting('amaaaze_secondary_color',array( 'default' => '#252525', 'transport' => 'reamaaaze', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control(new WP_Customize_Color_Control( $wp_customize, 'amaaaze_primary_color_control', array( 'label' => esc_html__('Primary color', 'amaaaze'), 'section' => 'amaaaze_standard_colors', 'settings' => 'amaaaze_primary_color' ) ) ); $wp_customize->add_control(new WP_Customize_Color_Control( $wp_customize, 'amaaaze_secondary_color_control', array( 'label' => esc_html__('Secondary color', 'amaaaze'), 'section' => 'amaaaze_standard_colors', 'settings' => 'amaaaze_secondary_color' ) ) ); // --- Header background $wp_customize->add_section('amaaaze_header', array( 'title' => esc_html__('Header Menu Colors', 'amaaaze'), 'description' => esc_html__('Modify the colors', 'amaaaze'), 'priority' => 45, )); $wp_customize->add_setting( 'header_background_color', array( 'default' => '#ffffff', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'reamaaaze', 'sanitize_callback' => 'sanitize_rgba_color', )); $wp_customize->add_control( new Amaaaze_Customize_Alpha_Color_Control( $wp_customize, 'header_background_color', array( 'label' => esc_html__('Edit header background color', 'amaaaze' ), 'section' => 'amaaaze_header', 'settings' => 'header_background_color', 'palette' => array( 'rgb(150, 50, 220)', // RGB, RGBa, and hex values supported 'rgba(50,50,50,0.8)', 'rgba( 255, 255, 255, 0.2 )', // Different spacing = no problem '#00CC99' // Mix of color types = no problem ) )) ); // ---- Link color $wp_customize->add_setting('menu_link_color', array( 'default' => '#252525', 'transport' => 'reamaaaze', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'menu_link_color', array( 'label' => esc_html__('Edit Menu link color', 'amaaaze'), 'section' => 'amaaaze_header', 'setting' => 'menu_link_color', ) )); // --- Link hover color $wp_customize->add_setting('menu_link_hover_color', array( 'default' => '#000000', 'transport' => 'reamaaaze', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'menu_link_hover_color', array( 'label' =>esc_html__('Edit Menu link hover color', 'amaaaze'), 'section' => 'amaaaze_header', 'setting' => 'menu_link_hover_color', ) )); // --- Link active color $wp_customize->add_setting('menu_active_color', array( 'default' => '#000000', 'transport' => 'reamaaaze', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'menu_active_color', array( 'label' =>esc_html__('Edit Menu active color', 'amaaaze'), 'section' => 'amaaaze_header', 'setting' => 'menu_active_color', ) )); // --- Link active background $wp_customize->add_setting( 'menu_active_background', array( 'default' => '#252525', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'reamaaaze', 'sanitize_callback' => 'sanitize_rgba_color', )); $wp_customize->add_control( new Amaaaze_Customize_Alpha_Color_Control( $wp_customize, 'menu_active_background', array( 'label' => esc_html__('Edit Menu active background', 'amaaaze' ), 'section' => 'amaaaze_header', 'settings' => 'menu_active_background', 'palette' => array( 'rgb(150, 50, 220)', // RGB, RGBa, and hex values supported 'rgba(50,50,50,0.8)', 'rgba( 255, 255, 255, 0.2 )', // Different spacing = no problem '#00CC99' // Mix of color types = no problem ) )) ); // --- Submenu background $wp_customize->add_setting( 'submenu_background_color', array( 'default' => '#f7f7f7', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'reamaaaze', 'sanitize_callback' => 'sanitize_rgba_color', )); $wp_customize->add_control( new Amaaaze_Customize_Alpha_Color_Control( $wp_customize, 'submenu_background_color', array( 'label' => esc_html__('Edit sub menu background color', 'amaaaze' ), 'section' => 'amaaaze_header', 'settings' => 'submenu_background_color', 'palette' => array( 'rgb(150, 50, 220)', // RGB, RGBa, and hex values supported 'rgba(50,50,50,0.8)', 'rgba( 255, 255, 255, 0.2 )', // Different spacing = no problem '#00CC99' // Mix of color types = no problem ) )) ); // --- Submenu Link $wp_customize->add_setting('submenu_link_color', array( 'default' => '#555555', 'transport' => 'reamaaaze', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'submenu_link_color', array( 'label' =>esc_html__('Edit sub menu link color', 'amaaaze'), 'section' => 'amaaaze_header', 'setting' => 'submenu_link_color', ) )); } add_action('customize_register','amaaaze_customize_register'); /** * Render the site title for the selective reamaaaze partial. * * @return void */ function amaaaze_customize_partial_blogname() { bloginfo( 'name' ); } /** * Render the site tagline for the selective reamaaaze partial. * * @return void */ function amaaaze_customize_partial_blogdescription() { bloginfo( 'description' ); } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function amaaaze_customize_preview_js() { wp_enqueue_script( 'amaaaze-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20151215', true ); } add_action( 'customize_preview_init', 'amaaaze_customize_preview_js' );