get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->get_setting( 'background_color' )->transport = 'postMessage'; //Assigning sections to panels $wp_customize->get_section('title_tagline')->panel = 'Header'; $wp_customize->get_section('title_tagline')->priority = 10; $wp_customize->get_section('header_image')->panel = 'Header'; $wp_customize->get_section('header_image')->priority = 30; $wp_customize->get_section('colors')->panel = 'Miscellaneous'; $wp_customize->get_section('colors')->priority = 50; $wp_customize->get_section('background_image')->panel = 'Miscellaneous'; $wp_customize->get_section('background_image')->priority = 40; $wp_customize->get_section('static_front_page')->panel = 'Frontpage'; $wp_customize->get_section('static_front_page')->priority = 100; $wp_customize->get_section('static_front_page')->panel = 'Miscellaneous'; $wp_customize->get_section('static_front_page')->panel = 'Frontpage'; //Move color section settings to respective sections $wp_customize->get_control('background_color')->section = 'basic_site_settings'; $wp_customize->get_setting('background_color')->section = 'basic_site_settings'; $wp_customize->get_control('header_textcolor')->section = 'header_tagline_color_section'; $wp_customize->get_setting('header_textcolor')->section = 'header_tagline_color_section'; $wp_customize->get_control('header_textcolor')->label = __('Site Tagline Color', 'tar'); /*-------------------------------------------------------------- ## Panels --------------------------------------------------------------*/ //Header panel $wp_customize->add_panel( 'Header', array( 'priority' => 10, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __( 'Header', 'tar' ), 'description' => __( 'Customize your header', 'tar' ), ) ); // Frontpage panel $wp_customize->add_panel( 'Frontpage', array( 'priority' => 20, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __( 'Frontpage', 'tar' ), 'description' => __( 'This panel allows you to customize entire frontpage', 'tar' ), ) ); // Miscellanious panel $wp_customize->add_panel( 'Miscellaneous', array( 'priority' => 40, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __( 'Miscellaneous', 'tar' ), 'description' => __( 'Miscellaneous Settings', 'tar' ), ) ); // Post & Page panel $wp_customize->add_panel( 'Page & Post', array( 'priority' => 30, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __( 'Page & Post', 'tar' ), 'description' => __( 'Page and Post settings', 'tar' ), ) ); //footer panel $wp_customize->add_panel( 'Footer', array( 'priority' => 50, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __( 'Footer', 'tar' ), 'description' => __( 'Footer Editing', 'tar' ), ) ); /*-------------------------------------------------------------- ## Header --------------------------------------------------------------*/ //Site title h1 color picker $wp_customize->add_section( 'header_h1_color_section' , array( 'title' => __('Site Title','tar'), 'panel' => 'Header', 'priority' => 20 ) ); $wp_customize->add_setting( 'header_h1_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_h1_color_control', array( 'label' => __( 'Color', 'tar' ), 'section' => 'header_h1_color_section', 'settings' => 'header_h1_color' ) ) ); //Site title h1 font size picker $wp_customize->add_setting( 'header_h1_font_size_setting', array( 'default' => '16px', 'sanitize_callback' => 'sanitize_key', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'header_h1_font_size', array( 'label' => __( 'font size', 'tar' ), 'section' => 'header_h1_color_section', 'settings' => 'header_h1_font_size_setting', 'type' => 'range', 'input_attrs' => array( 'min' => '10', 'max' => '30', 'step' => '1', ) ) ) ); //Site title h1 font thickness $wp_customize->add_setting( 'header_h1_font_weight', array( 'default' => '400', 'sanitize_callback' => 'sanitize_key', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'header_h1_font_weight_control', array( 'label' => __( 'Font Thickness', 'tar' ), 'section' => 'header_h1_color_section', 'settings' => 'header_h1_font_weight', 'type' => 'select', 'choices' => array( '300' => 'Extra Thin', '400' => 'Thin', '700' => 'Normal', ) ) ) ); //Site title letter spacing $wp_customize->add_setting( 'site_title_letter_spacing', array( 'default' => '', 'sanitize_callback' => 'sanitize_key', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'site_title_letter_spacing_control', array( 'label' => __( 'Letter Spacing', 'tar' ), 'section' => 'header_h1_color_section', 'settings' => 'site_title_letter_spacing', 'type' => 'range', 'input_attrs' => array( 'min' => '-5', 'max' => '5', 'step' => '1', ) ) ) ); //Site title Word spacing $wp_customize->add_setting( 'site_title_word_spacing', array( 'default' => '', 'sanitize_callback' => 'sanitize_key', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'site_title_word_spacing_control', array( 'label' => __( 'Word Spacing', 'tar' ), 'section' => 'header_h1_color_section', 'settings' => 'site_title_word_spacing', 'type' => 'range', 'input_attrs' => array( 'min' => '-5', 'max' => '5', 'step' => '1', ) ) ) ); //Site tagline color picker $wp_customize->add_section( 'header_tagline_color_section' , array( 'title' => __('Site Tagline','tar'), 'panel' => 'Header', 'priority' => 20 ) ); $wp_customize->add_setting( 'header_tagline_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_tagline_color_control', array( 'label' => __( 'Site Tagline Color', 'tar' ), 'section' => 'header_tagline_color_section', 'settings' => 'header_tagline_color' ) ) ); //Site tagline font size picker $wp_customize->add_setting( 'site_tagline_font_size', array( 'default' => '', 'sanitize_callback' => 'sanitize_key', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'site_tagline_font_size_control', array( 'label' => __( 'Font Size', 'tar' ), 'section' => 'header_tagline_color_section', 'settings' => 'site_tagline_font_size', 'type' => 'range', 'input_attrs' => array( 'min' => '10', 'max' => '30', 'step' => '1', ) ) ) ); //Site tagline font thickness $wp_customize->add_setting( 'header_site_tagline_font_weight', array( 'default' => '400', 'sanitize_callback' => 'sanitize_key', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'header_site_tagline_font_weight_control', array( 'label' => __( 'Font Thickness', 'tar' ), 'section' => 'header_tagline_color_section', 'settings' => 'header_site_tagline_font_weight', 'type' => 'select', 'choices' => array( '300' => 'Extra Thin', '400' => 'Thin', '700' => 'Normal', ) ) ) ); //Site tagline letter spacing $wp_customize->add_setting( 'site_tagline_letter_spacing', array( 'default' => '', 'sanitize_callback' => 'sanitize_key', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'site_tagline_letter_spacing_control', array( 'label' => __( 'Letter Spacing', 'tar' ), 'section' => 'header_tagline_color_section', 'settings' => 'site_tagline_letter_spacing', 'type' => 'range', 'input_attrs' => array( 'min' => '-5', 'max' => '5', 'step' => '1', ) ) ) ); //Site title Word spacing $wp_customize->add_setting( 'site_tagline_word_spacing', array( 'default' => '', 'sanitize_callback' => 'sanitize_key', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'site_tagline_word_spacing_control', array( 'label' => __( 'Word Spacing', 'tar' ), 'section' => 'header_tagline_color_section', 'settings' => 'site_tagline_word_spacing', 'type' => 'range', 'input_attrs' => array( 'min' => '-5', 'max' => '5', 'step' => '1', ) ) ) ); //Header Background color picker $wp_customize->add_section( 'header_background_color_section' , array( 'title' => __('Header Background Color','tar'), 'panel' => 'Header', 'priority' => 25 ) ); $wp_customize->add_setting( 'header_background_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_background_color', array( 'label' => __( 'Color', 'tar' ), 'section' => 'header_background_color_section', 'settings' => 'header_background_color' ) ) ); //Header Navigation $wp_customize->add_section( 'nav_settings' , array( 'title' => __('Navigation','tar'), 'description' => __('Live preview is not available for these settings, You need to save and refresh the page to see the applied changes' , 'tar'), 'panel' => 'Header', 'priority' => 45 ) ); //Nav text color $wp_customize->add_setting( 'nav_text_color', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nav_text_color_control', array( 'label' => __( 'Navigation Text Color', 'tar' ), 'section' => 'nav_settings', 'settings' => 'nav_text_color' ) ) ); //Nav hover text color $wp_customize->add_setting( 'nav_text_hover_color', array( 'default' => '#5b9cb1', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nav_text_hover_color_control', array( 'label' => __( 'Navigation Text Hover Color', 'tar' ), 'section' => 'nav_settings', 'settings' => 'nav_text_hover_color' ) ) ); //Nav ul bg color $wp_customize->add_setting( 'nav_ul_bg_color', array( 'default' => '#2a606f', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nav_ul_bg_color_control', array( 'label' => __( 'Second level Nav background Color', 'tar' ), 'section' => 'nav_settings', 'settings' => 'nav_ul_bg_color' ) ) ); //Nav li bottom border color $wp_customize->add_setting( 'nav_li_bottom_border_color', array( 'default' => '#2f6d8a', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nav_li_bottom_border_color_control', array( 'label' => __( 'Bottom border Color', 'tar' ), 'section' => 'nav_settings', 'settings' => 'nav_li_bottom_border_color' ) ) ); /*-------------------------------------------------------------- ## Call To Action(CTA) Section --------------------------------------------------------------*/ $wp_customize->add_section( 'cta-section', array( 'title' => __('Call To Action (CTA) Section', 'tar'), 'description' => '', 'priority' => 9, 'panel' => 'Frontpage' ) ); //CTA section display toggle $wp_customize->add_setting( 'cta_section_display_toggle', array( 'default' => 'true', 'sanitize_callback' => 'tar_checkbox_sanitize', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'cta_section_display_toggle_control', array( 'label' => __( 'Display CTA Section', 'tar' ), 'section' => 'cta-section', 'settings' => 'cta_section_display_toggle', 'type' => 'checkbox', ) ) ); //CTA welcome h2 text $wp_customize->add_setting( 'cta_welcome_text', array( 'default' => __('Advance. Strong. Reliable', 'tar'), 'transport' => 'postMessage', 'type' => 'option', 'sanitize_callback' => 'tar_sanitize_text', 'type' => 'option' ) ); $wp_customize->add_control( 'CTA-control', array( 'label' => __('H2 Text' , 'tar'), 'section' => 'cta-section', 'type' => 'text', 'settings' => 'cta_welcome_text' ) ); //welcome text h2 color picker $wp_customize->add_setting( 'tar_h2_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'custom_h1_color', array( 'label' => __( 'Text Color', 'tar' ), 'section' => 'cta-section', 'settings' => 'tar_h2_color' ) ) ); //welcome text h2 font size picker $wp_customize->add_setting( 'tar_htwo_font_size', array( 'default' => '', 'sanitize_callback' => 'absint', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'custom_htwo_font_size', array( 'label' => __( 'Font Size', 'tar' ), 'section' => 'cta-section', 'settings' => 'tar_htwo_font_size', 'type' => 'select', 'choices' => array( '22' => '22px', '28' => '28px', '36' => '36px', '42' => '42px', '48' => '48px', '54' => '54px', '60' => '60px', '70' => '70px', '76' => '76px' ) ) ) ); //welcome text h2 position $wp_customize->add_setting( 'cta_h2_position', array( 'default' => '', 'sanitize_callback' => 'sanitize_key', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'h2_position', array( 'label' => __( 'Text Position', 'tar' ), 'section' => 'cta-section', 'settings' => 'cta_h2_position', 'type' => 'select', 'choices' => array( 'left' => 'Left', 'right' => 'Right', 'center' => 'Center' ) ) ) ); //welcome text h2 font weight $wp_customize->add_setting( 'cta_h2_font_weight', array( 'default' => '', 'sanitize_callback' => 'absint', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'h1_position', array( 'label' => __( 'Font Thickness', 'tar' ), 'section' => 'cta-section', 'settings' => 'cta_h2_font_weight', 'type' => 'select', 'choices' => array( '300' => 'Extra Thin', '400' => 'Thin', '700' => 'Normal' ) ) ) ); //welcome text h2 letter spacing $wp_customize->add_setting( 'welcome_text_htwo_letter_spacing', array( 'default' => '', 'sanitize_callback' => 'sanitize_key', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'welcome_text_htwo_letter_spacing_control', array( 'label' => __( 'Letter Spacing', 'tar' ), 'section' => 'cta-section', 'settings' => 'welcome_text_htwo_letter_spacing', 'type' => 'range', 'input_attrs' => array( 'min' => '-5', 'max' => '10', 'step' => '1', ) ) ) ); //Welcome text h2 word spacing $wp_customize->add_setting( 'welcome_text_htwo_word_spacing', array( 'default' => '', 'sanitize_callback' => 'sanitize_key', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'welcome_text_htwo_word_spacing_control', array( 'label' => __( 'Word Spacing Range', 'tar' ), 'section' => 'cta-section', 'settings' => 'welcome_text_htwo_word_spacing', 'type' => 'range', 'input_attrs' => array( 'min' => '-10', 'max' => '10', 'step' => '1', ) ) ) ); // CTA background image Settings $wp_customize->add_setting( 'cta_background_image_setting', array( 'default' => get_template_directory_uri() . '/assets/images/banner.jpg', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'cta_background_image_control', array( 'label' => __( 'Change CTA Background Image', 'tar' ), 'section' => 'cta-section', 'settings' => 'cta_background_image_setting', /*'context' => 'tar-custom-logo'*/ ) ) ); $wp_customize->add_setting( 'cta_welcome_text_p', array( 'default' => __('A clean bloat free WordPress theme for your site', 'tar'), 'transport' => 'postMessage', 'type' => 'option', 'sanitize_callback' => 'sanitize_text_field', 'type' => 'option' ) ); $wp_customize->add_control( 'CTA-control-p', array( 'label' => __('Tagline Text' , 'tar'), 'section' => 'cta-section', 'type' => 'text', 'settings' => 'cta_welcome_text_p' ) ); //welcome text p color picker $wp_customize->add_setting( 'tar_p_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'custom_p_color', array( 'label' => __( ' Color ', 'tar' ), 'section' => 'cta-section', 'settings' => 'tar_p_color' ) ) ); //welcome text p font size picker $wp_customize->add_setting( 'tar_p_font_size', array( 'default' => '24px', 'sanitize_callback' => 'absint', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'custom_p_font_size', array( 'label' => __( 'Font Size', 'tar' ), 'section' => 'cta-section', 'settings' => 'tar_p_font_size', 'type' => 'select', 'choices' => array( '22' => '22px', '28' => '28px', '36' => '36px', '42' => '42px', '48' => '48px', '54' => '54px' ) ) ) ); //welcome text p position $wp_customize->add_setting( 'cta_p_position', array( 'default' => '', 'sanitize_callback' => 'sanitize_key', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'p_position', array( 'label' => __( 'Text Position', 'tar' ), 'section' => 'cta-section', 'settings' => 'cta_p_position', 'type' => 'select', 'choices' => array( 'left' => 'Left', 'right' => 'Right', 'center' => 'Center' ) ) ) ); //welcome text p letter spacing $wp_customize->add_setting( 'cta_p_letter_spacing', array( 'default' => '', 'sanitize_callback' => 'sanitize_key', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'cta_p_letter_spacing_control', array( 'label' => __( 'Letter Spacing', 'tar' ), 'section' => 'cta-section', 'settings' => 'cta_p_letter_spacing', 'type' => 'range', 'input_attrs' => array( 'min' => '-10', 'max' => '10', 'step' => '1', ) ) ) ); //Welcome text p word spacing $wp_customize->add_setting( 'cta_p_word_spacing', array( 'default' => '', 'sanitize_callback' => 'sanitize_key', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'cta_p_word_spacing_control', array( 'label' => __( 'Word Spacing Range', 'tar' ), 'section' => 'cta-section', 'settings' => 'cta_p_word_spacing', 'type' => 'range', 'input_attrs' => array( 'min' => '-10', 'max' => '15', 'step' => '1', ) ) ) ); $wp_customize->add_setting( 'cta-button-text', array( 'default' => __('Learn More', 'tar'), 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', 'type' => 'option' ) ); $wp_customize->add_control( 'cta-text-control', array( 'label' => __('Button Text', 'tar'), 'section' => 'cta-section', 'type' => 'text', 'settings' => 'cta-button-text' ) ); //CTA button href value $wp_customize->add_setting( 'cta_button_href', array( 'default' => '##', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw', 'type' => 'option' ) ); $wp_customize->add_control( 'cta_button_href', array( 'label' => __('Button Link', 'tar'), 'section' => 'cta-section', 'type' => 'text', 'settings' => 'cta_button_href' ) ); //CTA button smooth scroll /* $wp_customize->add_setting( 'smooth_scroll', array( 'default' => '##', //'transport' => 'refresh', // 'sanitize_callback' => 'esc_url_raw', 'type' => 'option' ) ); $wp_customize->add_control( 'smooth_scroll', array( 'label' => __('Smooth Scroll', 'tar'), 'section' => 'cta-section', 'type' => 'text', 'settings' => 'smooth_scroll' ) ); */ //CTA button TEXT color picker $wp_customize->add_setting( 'tar_button_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'custom_button_color', array( 'label' => __( 'Text Color', 'tar' ), 'section' => 'cta-section', 'settings' => 'tar_button_color' ) ) ); //welcome text button font size picker $wp_customize->add_setting( 'tar_button_font_size', array( 'default' => '24px', 'sanitize_callback' => 'absint', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'custom_button_font_size', array( 'label' => __( 'Font Size', 'tar' ), 'section' => 'cta-section', 'settings' => 'tar_button_font_size', 'type' => 'select', 'choices' => array( '12' => '12px', '14' => '14px', '16' => '16px', '18' => '18px', '20' => '20px', '22' => '22px', '28' => '28px', '32' => '32px', '42' => '42px' ) ) ) ); //CTA button background color picker $wp_customize->add_setting( 'tar_button_background_color', array( 'default' => '#f44', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'custom_button_background_color', array( 'label' => __( 'Button Background Color', 'tar' ), 'section' => 'cta-section', 'settings' => 'tar_button_background_color' ) ) ); //welcome text button style $wp_customize->add_setting( 'tar_button_style', array( 'default' => '', 'sanitize_callback' => 'absint', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'tar_button_style_control', array( 'label' => __( 'Button Border', 'tar' ), 'section' => 'cta-section', 'settings' => 'tar_button_style', 'type' => 'select', 'choices' => array( '0' => 'sharp border', '10' => 'semi-curved border', '20' => 'curved border', '35' => 'rounded border' ) ) ) ); /*-------------------------------------------------------------- ## Feature Section --------------------------------------------------------------*/ /*SECTION HEAD TEXT */ //Key Feature BLock $wp_customize->add_section( 'key_features_block', array( 'title' => __('Features Block Section', 'tar'), 'description' => '', 'priority' => 69, 'panel' => 'Frontpage' ) ); //Key Feature BLock section display toggle $wp_customize->add_setting( 'features_block_section_toggle', array( 'default' => 'true', 'sanitize_callback' => 'tar_checkbox_sanitize', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'features_block_section_toggle_control', array( 'label' => __( 'Display Features Section', 'tar' ), 'section' => 'key_features_block', 'settings' => 'features_block_section_toggle', 'type' => 'checkbox', ) ) ); //Feature Section Head Text settings $wp_customize->add_setting( 'features_head_text_settings', array( 'default' => __('Use this block to show six key features', 'tar'), 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', 'type' => 'option' ) ); $wp_customize->add_control( 'features_head_text_control', array( 'label' => __('Section Head Text' , 'tar'), 'section' => 'key_features_block', 'type' => 'text', 'settings' => 'features_head_text_settings' ) ); //Feature Section Head Text color picker $wp_customize->add_setting( 'features_head_text_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'features_head_text_color_control', array( 'label' => __( 'Text Color', 'tar' ), 'section' => 'key_features_block', 'settings' => 'features_head_text_color' ) ) ); //Feature Section background color picker $wp_customize->add_setting( 'features_background_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'features_background_color_control', array( 'label' => __( 'Section Background Color', 'tar' ), 'section' => 'key_features_block', 'settings' => 'features_background_color' ) ) ); //feature blocks h3 head text color $wp_customize->add_setting( 'blocks_head_text_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'blocks_head_text_color_control', array( 'label' => __( 'Features Block Head Text Color', 'tar' ), 'section' => 'key_features_block', 'settings' => 'blocks_head_text_color' ) ) ); //feature blocks para text color $wp_customize->add_setting( 'blocks_para_text_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'blocks_para_text_color_control', array( 'label' => __( 'Features Block Paragraph Text Color', 'tar' ), 'section' => 'key_features_block', 'settings' => 'blocks_para_text_color' ) ) ); /*******Feature Block One********/ //feature block one head text $wp_customize->add_setting( 'features_one_settings', array( 'default' => __('Dolore Libero', 'tar'), 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', 'type' => 'option' ) ); $wp_customize->add_control( 'features_one_settings_control', array( 'label' => __('Feature One Head Text' , 'tar'), 'section' => 'key_features_block', 'type' => 'text', 'settings' => 'features_one_settings' ) ); //block one para $wp_customize->add_setting( 'features_one_para_settings', array( 'default' => __('Aenean vel justo nulla, at gravida elit. In hac habitasse platea dictumst. Quisque gravida commodo volutpat. Vivamus blandit risus in urna venenatis accumsan.', 'tar'), 'transport' => 'postMessage', 'sanitize_callback' => 'wp_kses', 'type' => 'option' ) ); $wp_customize->add_control( 'features_one_para_control', array( 'label' => __('Block one Paragraph' , 'tar'), 'section' => 'key_features_block', 'type' => 'textarea', 'settings' => 'features_one_para_settings' ) ); //block one href link $wp_customize->add_setting( 'block_one_href', array( 'default' => 'http://asphaltthemes.com/', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw', 'type' => 'option' ) ); $wp_customize->add_control( 'block_one_href_control', array( 'label' => __('Image Link', 'tar'), 'section' => 'key_features_block', 'type' => 'text', 'settings' => 'block_one_href' ) ); //block one image $wp_customize->add_setting( 'block_one_image', array( 'default' => get_template_directory_uri() . '/assets/images/block1.jpg', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'block_one_image_control', array( 'label' => __( 'Feature One Image', 'tar' ), 'section' => 'key_features_block', 'settings' => 'block_one_image', ) ) ); //block one toggle button $wp_customize->add_setting( 'block_one_toggle', array( 'default' => 'true', 'sanitize_callback' => 'tar_checkbox_sanitize', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'block_one_toggle_control', array( 'label' => __( 'Display block One', 'tar' ), 'section' => 'key_features_block', 'settings' => 'block_one_toggle', 'type' => 'checkbox', ) ) ); //feature block two head $wp_customize->add_setting( 'features_two_setting', array( 'default' => __('Dolore Libero', 'tar'), 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', 'type' => 'option' ) ); $wp_customize->add_control( 'features_two_control', array( 'label' => __('Block Two Head Text' , 'tar'), 'section' => 'key_features_block', 'type' => 'text', 'settings' => 'features_two_setting' ) ); //block two para $wp_customize->add_setting( 'features_two_para_settings', array( 'default' => __('Aenean vel justo nulla, at gravida elit. In hac habitasse platea dictumst. Quisque gravida commodo volutpat. Vivamus blandit risus in urna venenatis accumsan.', 'tar'), 'transport' => 'postMessage', 'sanitize_callback' => 'wp_kses', 'type' => 'option' ) ); $wp_customize->add_control( 'features_two_para_control', array( 'label' => __('Block Two Paragraph' , 'tar'), 'section' => 'key_features_block', 'type' => 'textarea', 'settings' => 'features_two_para_settings' ) ); //block two href link $wp_customize->add_setting( 'block_two_href', array( 'default' => 'http://asphaltthemes.com', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw', 'type' => 'option' ) ); $wp_customize->add_control( 'block_two_href_control', array( 'label' => __('Image Link', 'tar'), 'section' => 'key_features_block', 'type' => 'text', 'settings' => 'block_two_href' ) ); //block two image $wp_customize->add_setting( 'block_two_image', array( 'default' => get_template_directory_uri() . '/assets/images/block2.jpg', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'block_two_image_control', array( 'label' => __( 'Feature Two Image', 'tar' ), 'section' => 'key_features_block', 'settings' => 'block_two_image', ) ) ); //block one toggle button $wp_customize->add_setting( 'block_two_toggle', array( 'default' => 'true', 'sanitize_callback' => 'tar_checkbox_sanitize', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'block_two_toggle_control', array( 'label' => __( 'Display block Two', 'tar' ), 'section' => 'key_features_block', 'settings' => 'block_two_toggle', 'type' => 'checkbox', ) ) ); //feature block three head $wp_customize->add_setting( 'features_three_setting', array( 'default' => __('Dolore Libero', 'tar'), 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', 'type' => 'option' ) ); $wp_customize->add_control( 'features_three_control', array( 'label' => __('Block Three Head Text' , 'tar'), 'section' => 'key_features_block', 'type' => 'text', 'settings' => 'features_three_setting' ) ); //block three para $wp_customize->add_setting( 'features_three_para_settings', array( 'default' => __('Aenean vel justo nulla, at gravida elit. In hac habitasse platea dictumst. Quisque gravida commodo volutpat. Vivamus blandit risus in urna venenatis accumsan.', 'tar'), 'transport' => 'postMessage', 'sanitize_callback' => 'wp_kses', 'type' => 'option' ) ); $wp_customize->add_control( 'features_three_para_control', array( 'label' => __('Block Three Paragraph' , 'tar'), 'section' => 'key_features_block', 'type' => 'textarea', 'settings' => 'features_three_para_settings' ) ); //block three href link $wp_customize->add_setting( 'block_three_href', array( 'default' => 'http://asphaltthemes.com', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw', 'type' => 'option', ) ); $wp_customize->add_control( 'block_three_href_control', array( 'label' => __('Image Link', 'tar'), 'section' => 'key_features_block', 'type' => 'text', 'settings' => 'block_three_href' ) ); //block three image $wp_customize->add_setting( 'block_three_image', array( 'default' => get_template_directory_uri() . '/assets/images/block3.jpg', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'block_three_image_control', array( 'label' => __( 'Feature Three Image', 'tar' ), 'section' => 'key_features_block', 'settings' => 'block_three_image', ) ) ); //block three toggle button $wp_customize->add_setting( 'block_three_toggle', array( 'default' => 'true', 'sanitize_callback' => 'tar_checkbox_sanitize', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'block_three_toggle_control', array( 'label' => __( 'Display block Three', 'tar' ), 'section' => 'key_features_block', 'settings' => 'block_three_toggle', 'type' => 'checkbox', ) ) ); /*-------------------------------------------------------------- ## Portfolio Section --------------------------------------------------------------*/ //Portfolio Category Dropdown $wp_customize->add_section( 'category_dropdown_section', array( 'title' => __('Portfolio Section', 'tar'), 'description' => __('Select Portfolio category' , 'tar'), 'priority' => 80, 'panel' => 'Frontpage' ) ); $cats = array(); foreach ( get_categories() as $categories => $category ){ $cats[$category->term_id] = $category->name; } $wp_customize->add_setting( 'cats_elect', array( 'default' => 1, 'sanitize_callback' => 'absint', 'type' => 'option' ) ); $wp_customize->add_control( 'cat_contlr', array( 'settings' => 'cats_elect', 'type' => 'select', 'choices' => $cats, 'section' => 'category_dropdown_section', // depending on where you want it to be ) ); //Portfolio section display toggle $wp_customize->add_setting( 'portfolio_section_toggle', array( 'default' => 'true', 'sanitize_callback' => 'tar_checkbox_sanitize', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'portfolio_section_toggle_control', array( 'label' => __( 'Display Portfolio Section', 'tar' ), 'section' => 'category_dropdown_section', 'settings' => 'portfolio_section_toggle', 'type' => 'checkbox', ) ) ); //head text $wp_customize->add_setting( 'porfolio_head_text', array( 'default' => __('See our Portfolio', 'tar'), 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', 'type' => 'option' ) ); $wp_customize->add_control( 'porfolio_head_text_control', array( 'label' => __('Customize Head Text' , 'tar'), 'section' => 'category_dropdown_section', 'type' => 'text', 'settings' => 'porfolio_head_text' ) ); //head text color $wp_customize->add_setting( 'porfolio_head_text_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'porfolio_head_text_color_control', array( 'label' => __( 'Head Text Color', 'tar' ), 'section' => 'category_dropdown_section', 'settings' => 'porfolio_head_text_color' ) ) ); //Portfolio Background Color $wp_customize->add_setting( 'porfolio_background_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'porfolio_background_color_control', array( 'label' => __( 'Background Color', 'tar' ), 'section' => 'category_dropdown_section', 'settings' => 'porfolio_background_color' ) ) ); /*-------------------------------------------------------------- ## Second CTA Section --------------------------------------------------------------*/ //2nd cta section $wp_customize->add_section( 'second_cta_section', array( 'title' => __('Second CTA Section', 'tar'), 'description' => '', 'priority' => 81, 'panel' => 'Frontpage' ) ); //2nd section display toggle $wp_customize->add_setting( 'second_cta_section_toggle', array( 'default' => 'true', 'sanitize_callback' => 'tar_checkbox_sanitize', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'second_cta_section_toggle_control', array( 'label' => __( 'Display Second CTA Section', 'tar' ), 'section' => 'second_cta_section', 'settings' => 'second_cta_section_toggle', 'type' => 'checkbox', ) ) ); //head text $wp_customize->add_setting( 'second_cta_head_text', array( 'default' => __('Ultrices ante sagittis nunc senectus libero netus', 'tar'), 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', 'type' => 'option' ) ); $wp_customize->add_control( 'second_cta_head_text_control', array( 'label' => __('Customize Head Text' , 'tar'), 'section' => 'second_cta_section', 'type' => 'text', 'settings' => 'second_cta_head_text' ) ); //head text color $wp_customize->add_setting( 'second_cta_head_text_color', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'second_cta_head_text_color_control', array( 'label' => __( ' Head Text Color', 'tar' ), 'section' => 'second_cta_section', 'settings' => 'second_cta_head_text_color' ) ) ); //second cta button text $wp_customize->add_setting( 'second_cta_button_text', array( 'default' => __('SEE MORE', 'tar'), 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', 'type' => 'option' ) ); $wp_customize->add_control( 'second_cta_button_text_control', array( 'label' => __('Customize Button Text' , 'tar'), 'section' => 'second_cta_section', 'type' => 'text', 'settings' => 'second_cta_button_text' ) ); //second cta button text color $wp_customize->add_setting( 'second_cta_button_text_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'second_cta_button_text_color_control', array( 'label' => __( 'Button Text Color', 'tar' ), 'section' => 'second_cta_section', 'settings' => 'second_cta_button_text_color' ) ) ); //2nd CTA button href value $wp_customize->add_setting( 'second_cta_button_href', array( 'default' => '', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw', 'type' => 'option' ) ); $wp_customize->add_control( 'second_cta_button_href_control', array( 'label' => __('Button Link', 'tar'), 'section' => 'second_cta_section', 'type' => 'text', 'settings' => 'second_cta_button_href' ) ); //second cta button background color $wp_customize->add_setting( 'second_cta_button_background_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'second_cta_button_background_color_control', array( 'label' => __( 'Button Background Color', 'tar' ), 'section' => 'second_cta_section', 'settings' => 'second_cta_button_background_color' ) ) ); //second cta section background color $wp_customize->add_setting( 'second_cta_background_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'second_cta_background_color_control', array( 'label' => __( 'Section Background Color', 'tar' ), 'section' => 'second_cta_section', 'settings' => 'second_cta_background_color' ) ) ); if ( class_exists( 'WP_Customize_Control' ) && ! class_exists( 'tar_Custom_Content' ) ) : class tar_Custom_Content extends WP_Customize_Control { // Whitelist content parameter public $content = ''; /** * Render the control's content. * * Allows the content to be overriden without having to rewrite the wrapper. * * @since 1.0.0 * @return void */ public function render_content() { if ( isset( $this->label ) ) { echo '' . $this->label . ''; } if ( isset( $this->content ) ) { echo $this->content; } if ( isset( $this->description ) ) { echo '' . $this->description . ''; } } } endif; $wp_customize->add_setting( 'example-control', array( 'default' => 1, 'sanitize_callback' => 'sanitize_text' ) ); $wp_customize->add_control( new tar_Custom_Content( $wp_customize, 'example-control', array( 'section' => 'second_cta_section', 'content' => __( 'Changing Background Image is available for PRO users only', 'tar' ) . '

', 'settings' => 'example-control', ) ) ); /*-------------------------------------------------------------- ## Blog Section --------------------------------------------------------------*/ //Blog Category Dropdown $wp_customize->add_section( 'blog_dropdown_section', array( 'title' => __('Blog Section', 'tar'), 'description' => __('Select Blog category' , 'tar'), 'priority' => 83, 'panel' => 'Frontpage' ) ); //blog category $cats = array(); foreach ( get_categories() as $categories => $category ){ $cats[$category->term_id] = $category->name; } $wp_customize->add_setting( 'blog_cats', array( 'default' => 1, 'sanitize_callback' => 'absint', 'type' => 'option' ) ); $wp_customize->add_control( 'blog_cats_control', array( 'settings' => 'blog_cats', 'type' => 'select', 'choices' => $cats, 'section' => 'blog_dropdown_section', // depending on where you want it to be ) ); //Blog section display toggle $wp_customize->add_setting( 'blog_section_toggle', array( 'default' => 'true', 'sanitize_callback' => 'tar_checkbox_sanitize', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blog_section_toggle_control', array( 'label' => __( 'Display Blog Section', 'tar' ), 'section' => 'blog_dropdown_section', 'settings' => 'blog_section_toggle', 'type' => 'checkbox', ) ) ); //head text $wp_customize->add_setting( 'blog_head_text', array( 'default' => __('Check out blog', 'tar'), 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', 'type' => 'option' ) ); $wp_customize->add_control( 'blog_head_text_control', array( 'label' => __('Customize Blog Section Head Text' , 'tar'), 'section' => 'blog_dropdown_section', 'type' => 'text', 'settings' => 'blog_head_text' ) ); //head text color $wp_customize->add_setting( 'blog_head_text_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'blog_head_text_color_control', array( 'label' => __( 'Blog Head Text Color', 'tar' ), 'section' => 'blog_dropdown_section', 'settings' => 'blog_head_text_color' ) ) ); //section background color $wp_customize->add_setting( 'blog_bg_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'blog_bg_color_control', array( 'label' => __( 'Section Background Color', 'tar' ), 'section' => 'blog_dropdown_section', 'settings' => 'blog_bg_color' ) ) ); //More options for pro $wp_customize->add_setting( 'example-control-blog', array( 'default' => '', 'sanitize_callback' => 'sanitize_text', ) ); $wp_customize->add_control( new tar_Custom_Content( $wp_customize, 'example-blog-control', array( 'section' => 'blog_dropdown_section', 'content' => __( 'Advance customization for this section is available for PRO users only', 'tar' ) . '

', 'settings' => 'example-control-blog', ) ) ); /*-------------------------------------------------------------- ## Email Opt In Section --------------------------------------------------------------*/ //Opt in Header text Message $wp_customize->add_section( 'email_subscribe_section', array( 'title' => __('Text Section', 'tar'), 'description' => '', 'priority' => 90, 'panel' => 'Frontpage' ) ); //Text section display toggle $wp_customize->add_setting( 'text_section_toggle', array( 'default' => 'true', 'sanitize_callback' => 'tar_checkbox_sanitize', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'text_section_toggle_control', array( 'label' => __( 'Display Text Section', 'tar' ), 'section' => 'email_subscribe_section', 'settings' => 'text_section_toggle', 'type' => 'checkbox', ) ) ); $wp_customize->add_setting( 'email_subscribe_header', array( 'default' => __('Aenean vel justo nulla, at gravida elit. In hac habitasse platea dictumst. Quisque gravida commodo volutpat. Vivamus blandit risus in urna venenatis accumsan ', 'tar'), 'transport' => 'postMessage', 'type' => 'option', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'email_subscribe', array( 'label' => __('Section Head Text' , 'tar'), 'section' => 'email_subscribe_section', 'type' => 'textarea', 'settings' => 'email_subscribe_header' ) ); //Header TEXT color picker $wp_customize->add_setting( 'email_head_text_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'head_text_color', array( 'label' => __( ' Head Text Color', 'tar' ), 'section' => 'email_subscribe_section', 'settings' => 'email_head_text_color' ) ) ); //Email head text font size picker $wp_customize->add_setting( 'email_head_font_size', array( 'default' => '24px', 'sanitize_callback' => 'absint', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'email_header_font_size', array( 'label' => __( 'Head Text Font Size', 'tar' ), 'section' => 'email_subscribe_section', 'settings' => 'email_head_font_size', 'type' => 'select', 'choices' => array( '14' => '14px', '16' => '16px', '18' => '18px', '20' => '20px', '22' => '22px', '28' => '28px', '32' => '32px', '42' => '42px' ) ) ) ); //Opt In section text position $wp_customize->add_setting( 'opt_in_position', array( 'default' => '', 'sanitize_callback' => 'sanitize_key', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'optin_position', array( 'label' => __( 'Section Text Alignment', 'tar' ), 'section' => 'email_subscribe_section', 'settings' => 'opt_in_position', 'type' => 'select', 'choices' => array( 'left' => 'Left', 'center' => 'center', 'right' => 'Right', ) ) ) ); //Email section Background color picker $wp_customize->add_setting( 'optin_background_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'optin_background_color_control', array( 'label' => __( 'Section Background Color', 'tar' ), 'section' => 'email_subscribe_section', 'settings' => 'optin_background_color' ) ) ); //More options for pro $wp_customize->add_setting( 'example-control-text', array( 'default' => '', 'sanitize_callback' => 'sanitize_text' ) ); $wp_customize->add_control( new tar_Custom_Content( $wp_customize, 'example-control-text', array( 'section' => 'email_subscribe_section', 'content' => __( 'Changing Background Image is available for PRO users only', 'tar' ) . '

', 'settings' => 'example-control-text', ) ) ); /*-------------------------------------------------------------- ## Posts & Page --------------------------------------------------------------*/ $wp_customize->add_section( 'error_page' , array( 'title' => __('PRO users only','tar'), 'panel' => 'Page & Post', 'priority' => 41 ) ); $wp_customize->add_setting( 'error_head_text_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_text', 'type' => 'option' ) ); $wp_customize->add_control( 'error_head_text_color_control', array( 'section' => 'error_page', 'settings' => 'error_head_text_color', 'panel' => 'Page & Post' ) ); /*-------------------------------------------------------------- ## Miscellaneous --------------------------------------------------------------*/ // Add Custom CSS Textfield $wp_customize->add_section( 'custom_css_field' , array( 'title' => __('Custom CSS','tar'), 'panel' => 'Miscellaneous', //'priority' => 10 ) ); $wp_customize->add_setting( 'tar_custom_css', array( 'sanitize_callback' => 'wp_filter_nohtml_kses', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'custom_css', array( 'label' => __( 'Add custom CSS here', 'tar' ), 'section' => 'custom_css_field', 'settings' => 'tar_custom_css', 'type' => 'textarea' ) ) ); // Basic site settings $wp_customize->add_section( 'basic_site_settings' , array( 'title' => __('Basic Site Settings','tar'), 'panel' => 'Miscellaneous', 'description' => __('Basic site settings that will reflect styles (ex: font-family, color etc) throughout the site', 'tar'), //'priority' => 10 ) ); //site font family $wp_customize->add_setting( 'body_font_family', array( 'default' => '', 'sanitize_callback' => 'wp_kses_post', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'body_font_family_control', array( 'label' => __( 'Font-Family', 'tar' ), 'section' => 'basic_site_settings', 'settings' => 'body_font_family', 'type' => 'select', 'choices' => tar_fonts() ) ) ); //text color $wp_customize->add_setting( 'site_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'site_color_control', array( 'label' => __( 'Text Color', 'tar' ), 'section' => 'basic_site_settings', 'settings' => 'site_color' ) ) ); //link color $wp_customize->add_setting( 'site_Link_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'site_Link_color_control', array( 'label' => __( 'Link Color', 'tar' ), 'section' => 'basic_site_settings', 'settings' => 'site_Link_color' ) ) ); //link hover color $wp_customize->add_setting( 'site_Link_hover_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'site_Link_hover_color_control', array( 'label' => __( 'Link hover Color', 'tar' ), 'section' => 'basic_site_settings', 'settings' => 'site_Link_hover_color' ) ) ); /*-------------------------------------------------------------- ## Footer --------------------------------------------------------------*/ $wp_customize->add_section( 'footer_background_color_section' , array( 'title' => __('Footer Customization','tar'), 'panel' => 'Footer', 'priority' => 25 ) ); //Footer Background color picker $wp_customize->add_setting( 'footer_background_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_background_color', array( 'label' => __( 'Background Color', 'tar' ), 'section' => 'footer_background_color_section', 'settings' => 'footer_background_color' ) ) ); //footer background image $wp_customize->add_setting( 'example-control-footer', array( 'default' => '', 'sanitize_callback' => 'sanitize_text' ) ); $wp_customize->add_control( new tar_Custom_Content( $wp_customize, 'example-control-footer', array( 'section' => 'footer_background_color_section', 'content' => __( 'For PRO users only', 'tar' ) . '

', 'settings' => 'example-control-footer', 'label' => __( 'Background Image', 'tar' ), ) ) ); //Footer widget h2 color picker $wp_customize->add_setting( 'footer_widget_title_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_widget_title_color_control', array( 'label' => __( 'Widget H2 Color', 'tar' ), 'section' => 'footer_background_color_section', 'settings' => 'footer_widget_title_color' ) ) ); //widget title font size picker $wp_customize->add_setting( 'footer_widget_font_size', array( 'default' => '24px', 'sanitize_callback' => 'absint', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'footer_widget_font_size_control', array( 'label' => __( 'Widget H2 Font Size', 'tar' ), 'section' => 'footer_background_color_section', 'settings' => 'footer_widget_font_size', 'type' => 'select', 'choices' => array( '14' => '14px', '22' => '22px', '28' => '28px', '32' => '32px', '42' => '42px' ) ) ) ); //widget link color $wp_customize->add_setting( 'footer_widget_link_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_widget_link_color_control', array( 'label' => __( 'Widget Link Color', 'tar' ), 'section' => 'footer_background_color_section', 'settings' => 'footer_widget_link_color' ) ) ); //widget Text color $wp_customize->add_setting( 'footer_widget_text_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'type' => 'option' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_widget_text_color_control', array( 'label' => __( 'Widget Text Color', 'tar' ), 'section' => 'footer_background_color_section', 'settings' => 'footer_widget_text_color' ) ) ); //Important Links End //Custom control for dropdown category multiple select class tar_Important_Links extends WP_Customize_Control { public $type = 'important-links'; public function render_content() { //Add Theme instruction, Support Forum, Changelog, Donate link, Review, Facebook, Twitter, Google+, Pinterest links $important_links = array( 'Documentation' => array( 'link' => esc_url( 'http://asphaltthemes.com/documentation/' ), 'text' => __( 'Documentation', 'tar' ), ), 'Rate' => array( 'link' => esc_url( 'https://wordpress.org/support/view/theme-reviews/tar' ), 'text' => __( 'Rate Tar', 'tar' ), ), 'TAR PRO DEMO' => array( 'link' => esc_url( 'http://tarpro.asphaltthemes.com//' ), 'text' => __( 'PRO version Demo', 'tar' ), ), 'Contact' => array( 'link' => esc_url( 'http://asphaltthemes.com/contact/' ), 'text' => __( 'Contact', 'tar' ), ), 'twitter' => array( 'link' => esc_url( 'https://twitter.com/Asphalt_Themes' ), 'text' => __( 'Follow on Twitter', 'tar' ), ), ); foreach ( $important_links as $important_link) { echo '

' . esc_attr( $important_link['text'] ) .'

'; } } } //Important Links $wp_customize->add_section( 'important_links', array( 'priority' => 999, 'title' => __( 'Important Links', 'tar' ), ) ); /** * Has dummy Sanitizaition function as it contains no value to be sanitized */ $wp_customize->add_setting( 'important_links', array( 'sanitize_callback' => 'tar_sanitize_important_link', ) ); $wp_customize->add_control( new tar_Important_Links( $wp_customize, 'important_links', array( 'label' => __( 'Important Links', 'tar' ), 'section' => 'important_links', 'settings' => 'important_links', 'type' => 'important_links', ) ) ); } add_action( 'customize_register', 'tar_customize_register' ); function tar_fonts(){ $font_family_array = array( 'Arial, Helvetica, sans-serif' => 'Arial', 'Arial Black, Gadget, sans-serif' => 'Arial Black', 'Courier New', 'monospace' => 'Courier New', 'Lobster Two, cursive' => 'Lobster - Cursive', 'Georgia, serif' => 'Georgia', 'Impact, Charcoal, sans-serif' => 'Impact', 'Lucida Console, Monaco, monospace' => 'Lucida Console', 'Lucida Sans Unicode sans-serif' => 'Lucida Sans Unicode', 'MS Sans Serif, Geneva, sans-serif' => 'MS Sans Serif', 'MS Serif, New York, serif' => 'MS Serif', 'Open Sans, sans-serif' => 'Open Sans', 'Source Sans Pro, sans-serif' => 'Source Sans Pro', 'Lato, sans-serif' => 'Lato', 'Tahoma, Geneva, sans-serif' => 'Tahoma', 'Times New Roman, Times, serif' => 'Times New Roman', 'Trebuchet MS, sans-serif' => 'Trebuchet MS', 'Verdana, Geneva, sans-serif' => 'Verdana', 'Raleway, sans-serif' => 'Raleway', 'Roboto Condensed, sans-serif' => 'Robot Condensed', 'PT Sans, sans-serif' => 'PT Sans', 'Open Sans Condensed, sans-serif' => 'Open Sans Condensed', 'Roboto Slab, sans-serif' => 'Roboto Slab', 'Droid Sans, sans-serif' => 'Droid Sans', 'Ubuntu, sans-serif' => 'Ubuntu', 'Tangerine, serif' => 'Tangerine serif', 'Josefin Slab, sans-serif' => 'Josefin Slab', 'Arvo, sans-serif' => 'Arvo', 'Vollkorn, sans-serif' => 'Vollkorn', 'Abril Fatface, cursive' => 'Abril Fatface', 'Old Standard TT, serif' => 'Old Standard TT', 'Anivers, sans-serif' => 'Anivers', 'Junction, sans-serif' => 'Junction', 'Fertigo, sans-serif' => 'Fertigo', 'Aller, sans-serif' => 'Aller', 'Audimat, sans-serif' => 'Audimat', 'Delicious, sans-serif' => 'Delicious', 'Prociono, sans-serif' => 'Prociono', 'Fontin, sans-serif' => 'Fontin', 'Fontin-Sans, sans-serif' => 'Fontin-Sans', 'Playfair Display, sans-serif' => 'Playfair Display', 'Work Sans, sans-serif' => 'Work Sans', 'Alegreya, sans-serif' => 'Alegreya', 'Alegreya Sans, sans-serif' => 'Alegreya Sans', 'Fira Sans, sans-serif' => 'Fira Sans', 'Inconsolata, sans-serif' => 'Inconsolata', 'Source Serif Pro, sans-serif' => 'Source Serif Pro', 'Lora, sans-serif' => 'Lora', 'Karla, sans-serif' => 'Karla', 'Cardo, sans-serif' => 'Cardo', 'Bitter, sans-serif' => 'Bitter', 'Domine, sans-serif' => 'Domine', 'Varela Round, sans-serif' => 'Varela Round', 'Chivo, sans-serif' => 'Chivo', 'Montserrat, sans-serif' => 'Montserrat', 'Crimson Text, sans-serif' => 'Crimson Text', 'Libre Baskerville, sans-serif' => 'Libre Baskerville', 'Archivo Narrow, sans-serif' => 'Archivo Narrow', 'Anonymous Pro, sans-serif' => 'Anonymous Pro', 'Merriweather, sans-serif' => 'Merriweather', 'Neuton, sans-serif' => 'Neuton', 'Poppins, sans-serif' => 'Poppins', 'Noto Sans, sans-serif' => 'Noto Sans', ); return $font_family_array; } // Sanitize text function tar_sanitize_text( $text ) { return wp_kses_post( force_balance_tags( $text ) ); } // Sanitize textarea function tar_sanitize_css( $input ) { return wp_filter_nohtml_kses( $input ); } // checkbox sanitization function tar_checkbox_sanitize($input) { if ( $input == 1 ) { return 1; } else { return ''; } } function athena_icon_sanitize( $input ) { $valid_keys = athena_icons(); if (array_key_exists($input, $valid_keys)) { return $input; } else { return ''; } } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function tar_customize_preview_js() { wp_enqueue_script( 'tar_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true ); } add_action( 'customize_preview_init', 'tar_customize_preview_js' );