get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->get_section('header_image')->title = __( 'Header', 'apppage' ); $wp_customize->get_section('colors')->title = __( 'Background Color', 'apppage' ); $wp_customize->add_panel( 'theme_options' , array( 'title' => esc_html__( 'Theme Options', 'apppage' ), 'description' => '' ) ); $wp_customize->add_setting( 'header_title_color', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_title_color', array( 'label' => __( 'Header Title Color', 'apppage' ), 'section' => 'header_image', 'priority' => 1, 'settings' => 'header_title_color', ) ) ); $wp_customize->add_setting( 'left_button_text', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'left_button_text', array( 'label' => __( "Left Button Text", 'apppage' ), 'section' => 'header_image', 'type' => 'text', 'description' => __( 'For example: Left Button', 'apppage' ), 'priority' => 1, ) ); $wp_customize->add_setting( 'left_button_link', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( 'left_button_link', array( 'label' => __( "Left Button Link URL", 'apppage' ), 'section' => 'header_image', 'description' => __( 'For example: Http://google.com/', 'apppage' ), 'type' => 'text', 'priority' => 1, ) ); $wp_customize->add_setting( 'right_button_text', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'right_button_text', array( 'label' => __( "Right Button Text", 'apppage' ), 'section' => 'header_image', 'type' => 'text', 'description' => __( 'For example: right Button', 'apppage' ), 'priority' => 1, ) ); $wp_customize->add_setting( 'right_button_link', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( 'right_button_link', array( 'label' => __( "Right Button Link URL", 'apppage' ), 'section' => 'header_image', 'description' => __( 'For example: Http://google.com/', 'apppage' ), 'type' => 'text', 'priority' => 1, ) ); $wp_customize->add_setting( 'header_button_color', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_button_color', array( 'label' => __( 'Buttons Color', 'apppage' ), 'section' => 'header_image', 'priority' => 1, 'settings' => 'header_button_color', ) ) ); $wp_customize->add_setting( 'header_widget_titles', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_widget_titles', array( 'label' => __( 'Left Widget Headline Color', 'apppage' ), 'section' => 'header_image', 'priority' => 1, 'settings' => 'header_widget_titles', ) ) ); $wp_customize->add_setting( 'header_widget_text', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_widget_text', array( 'label' => __( 'Left Widget Text Color', 'apppage' ), 'section' => 'header_image', 'priority' => 1, 'settings' => 'header_widget_text', ) ) ); $wp_customize->add_setting( 'header_widget_link', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_widget_link', array( 'label' => __( 'Left Widget Link Color', 'apppage' ), 'section' => 'header_image', 'priority' => 1, 'settings' => 'header_widget_link', ) ) ); $wp_customize->add_setting( 'header_bg_color', array( 'default' => '#1b1b1b', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_bg_color', array( 'label' => __( 'Header Background Color', 'apppage' ), 'description' => __( 'Applied to header background.', 'apppage' ), 'section' => 'header_image', 'settings' => 'header_bg_color', ) ) ); $wp_customize->add_control( 'header_textcolor', array( 'label' => __( 'Header Text Color', 'apppage' ), 'section' => 'head_options', ) ); // Social Media Settings $wp_customize->add_section( 'apppage_navigation' , array( 'title' => esc_html__('Navigation', 'apppage'), 'priority' => 1, ) ); $wp_customize->add_setting( 'apppage_facebook', array( 'default' => '', 'description' => __( 'Enter your social media link(URL. Icons will not show if left blank.', 'apppage' ), 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_setting( 'apppage_twitter', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_setting( 'apppage_instagram', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_setting( 'apppage_pinterest', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_setting( 'apppage_tumblr', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_setting( 'apppage_bloglovin', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_setting( 'apppage_google', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_setting( 'apppage_youtube', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_setting( 'apppage_soundcloud', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_setting( 'apppage_vimeo', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_setting( 'apppage_linkedin', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_setting( 'apppage_rss', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'apppage_facebook', array( 'label' => esc_html__('Facebook', 'apppage'), 'section' => 'apppage_navigation', 'description' => __( 'Enter your social media link(URL). Icons will not show if left blank. For example http://facebook.com/user/', 'apppage' ), 'settings' => 'apppage_facebook', 'type' => 'text', 'priority' => 99 ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'apppage_twitter', array( 'label' => esc_html__('Twitter', 'apppage'), 'section' => 'apppage_navigation', 'description' => __( 'Enter your social media link(URL). Icons will not show if left blank. For example http://facebook.com/user/', 'apppage' ), 'settings' => 'apppage_twitter', 'type' => 'text', 'priority' => 99 ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'apppage_instagram', array( 'label' => esc_html__('Instagram', 'apppage'), 'section' => 'apppage_navigation', 'description' => __( 'Enter your social media link(URL). Icons will not show if left blank. For example http://facebook.com/user/', 'apppage' ), 'settings' => 'apppage_instagram', 'type' => 'text', 'priority' => 99 ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'apppage_pinterest', array( 'label' => esc_html__('Pinterest', 'apppage'), 'section' => 'apppage_navigation', 'description' => __( 'Enter your social media link(URL). Icons will not show if left blank. For example http://facebook.com/user/', 'apppage' ), 'settings' => 'apppage_pinterest', 'type' => 'text', 'priority' => 99 ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'apppage_bloglovin', array( 'label' => esc_html__('Bloglovin', 'apppage'), 'section' => 'apppage_navigation', 'description' => __( 'Enter your social media link(URL). Icons will not show if left blank. For example http://facebook.com/user/', 'apppage' ), 'settings' => 'apppage_bloglovin', 'type' => 'text', 'priority' => 99 ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'apppage_google', array( 'label' => esc_html__('Google Plus', 'apppage'), 'section' => 'apppage_navigation', 'description' => __( 'Enter your social media link(URL). Icons will not show if left blank. For example http://facebook.com/user/', 'apppage' ), 'settings' => 'apppage_google', 'type' => 'text', 'priority' => 99 ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'apppage_tumblr', array( 'label' => esc_html__('Tumblr', 'apppage'), 'section' => 'apppage_navigation', 'description' => __( 'Enter your social media link(URL). Icons will not show if left blank. For example http://facebook.com/user/', 'apppage' ), 'settings' => 'apppage_tumblr', 'type' => 'text', 'priority' => 99 ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'apppage_youtube', array( 'label' => esc_html__('Youtube', 'apppage'), 'section' => 'apppage_navigation', 'description' => __( 'Enter your social media link(URL). Icons will not show if left blank. For example http://facebook.com/user/', 'apppage' ), 'settings' => 'apppage_youtube', 'type' => 'text', 'priority' => 99 ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'apppage_soundcloud', array( 'label' => esc_html__('Soundcloud', 'apppage'), 'section' => 'apppage_navigation', 'description' => __( 'Enter your social media link(URL). Icons will not show if left blank. For example http://facebook.com/user/', 'apppage' ), 'settings' => 'apppage_soundcloud', 'type' => 'text', 'priority' => 99 ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'apppage_vimeo', array( 'label' => esc_html__('Vimeo', 'apppage'), 'section' => 'apppage_navigation', 'description' => __( 'Enter your social media link(URL). Icons will not show if left blank. For example http://facebook.com/user/', 'apppage' ), 'settings' => 'apppage_vimeo', 'type' => 'text', 'priority' => 99 ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'apppage_linkedin', array( 'label' => esc_html__('Linkedin', 'apppage'), 'section' => 'apppage_navigation', 'description' => __( 'Enter your social media link(URL). Icons will not show if left blank. For example http://facebook.com/user/', 'apppage' ), 'settings' => 'apppage_linkedin', 'type' => 'text', 'priority' => 99 ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'apppage_rss', array( 'label' => esc_html__('Rss', 'apppage'), 'section' => 'apppage_navigation', 'description' => __( 'Enter your social media link(URL). Icons will not show if left blank. For example http://facebook.com/user/', 'apppage' ), 'settings' => 'apppage_rss', 'type' => 'text', 'priority' => 99 ) ) ); // Social Media Settings } add_action( 'customize_register', 'apppage_customize_register' ); function apppage_sanitize_checkbox( $input ){ if ( $input == 1 || $input == 'true' || $input === true ) { return 1; } else { return 0; } } function apppage_sanitize_number( $number, $setting ) { $number = absint( $number ); return ( $number ? $number : $setting->default ); } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function apppage_customize_preview_js() { wp_enqueue_script( 'apppage_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20151215', true ); } add_action( 'customize_preview_init', 'apppage_customize_preview_js' ); /** * Load customizer style */ function apppage_customizer_load_css(){ wp_enqueue_style( 'apppage-customizer', get_template_directory_uri() . '/css/customizer.css' ); } add_action('customize_controls_print_styles', 'apppage_customizer_load_css'); if(! function_exists('apppage_custom_css_changes' ) ): function apppage_custom_css_changes(){ ?>