get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; // ============================== // ====== General Settings ====== // ============================== $wp_customize->get_section('title_tagline')->title = esc_html__('General Settings', 'blocal'); $wp_customize->get_section('title_tagline')->priority = 3; //Logo upload $wp_customize->add_setting('logo', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_upload' )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'logo', array( 'label' => __('Logo Upload', 'blocal'), 'section' => 'title_tagline', 'settings' => 'logo', ))); $wp_customize->add_setting('header_logo_area', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_choices', )); $wp_customize->add_setting( 'animation_option', array( 'default' => 'on', 'sanitize_callback' => 'blocal_sanitize_choices' ) ); $wp_customize->add_control( 'animation_option', array( 'label' => __('Theme Animation', 'blocal'), 'section' => 'title_tagline', 'settings' => 'animation_option', 'type' => 'radio', 'choices' => array( 'on' => 'On', 'off' => 'Off', ), ) ); // =============================== // ===== Social Links Option ===== // =============================== $wp_customize->add_section('social_section', array( 'title' => __('Top Nav Options', 'blocal'), 'priority' => 6, )); $wp_customize->add_setting('social_facebook', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('social_facebook', array( 'label' => __('Facebook Page URL', 'blocal'), 'section' => 'social_section', 'settings' => 'social_facebook', 'type' => 'text', )); $wp_customize->add_setting('social_twitter', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('social_twitter', array( 'label' => __('Twitter Page URL', 'blocal'), 'section' => 'social_section', 'settings' => 'social_twitter', 'type' => 'text', )); $wp_customize->add_setting('social_google_plus', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('social_google_plus', array( 'label' => __('Google Plus Page URL', 'blocal'), 'section' => 'social_section', 'settings' => 'social_google_plus', 'type' => 'text', )); $wp_customize->add_setting('social_pinterest', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('social_pinterest', array( 'label' => __('Pinterest Page URL', 'blocal'), 'section' => 'social_section', 'settings' => 'social_pinterest', 'type' => 'text', )); $wp_customize->add_setting('social_linkedin', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('social_linkedin', array( 'label' => __('Linkedin Page URL', 'blocal'), 'section' => 'social_section', 'settings' => 'social_linkedin', 'type' => 'text', )); $wp_customize->add_setting('social_youtube', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('social_youtube', array( 'label' => __('Youtube Page URL', 'blocal'), 'section' => 'social_section', 'settings' => 'social_youtube', 'type' => 'text', )); // ============================== // ==== Top Feature Option ===== // ============================== $wp_customize->add_section('top_feature_section', array( 'title' => __('Top Feature Image', 'blocal'), 'priority' => 9, )); $wp_customize->add_setting('slider_on_off', array( 'capability' => 'edit_theme_options', 'default' => 'on', 'sanitize_callback' => 'blocal_sanitize_choices' )); $wp_customize->add_control('slider_on_off', array( 'label' => __('Top Feature Image On/Off', 'blocal'), 'section' => 'top_feature_section', 'settings' => 'slider_on_off', 'type' => 'radio', 'choices' => array( 'on' => 'On', 'off' => 'Off', ), )); $wp_customize->add_setting('first_slider_image', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_upload' )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'first_slider_image', array( 'label' => __('Feature Image', 'blocal'), 'section' => 'top_feature_section', 'settings' => 'first_slider_image', ))); $wp_customize->add_setting('first_slider_title', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('first_slider_title', array( 'label' => __('Feature Image Title', 'blocal'), 'settings' => 'first_slider_title', 'section' => 'top_feature_section', 'type' => 'text', )); $wp_customize->add_setting('first_slider_des', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('first_slider_des', array( 'label' => __('Feature Image Description', 'blocal'), 'settings' => 'first_slider_des', 'section' => 'top_feature_section', 'type' => 'textarea', )); // ===================================== // ======= Call to action button ======= // ===================================== $wp_customize->add_section('call_to_action', array( 'title' => __('Call to Action Buttons', 'blocal'), 'priority' => 15, )); /* First Call to action Button Options */ $wp_customize->add_setting('first_btn_icon', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('first_btn_icon', array( 'label' => __('First Button Icon', 'blocal'), 'settings' => 'first_btn_icon', 'section' => 'call_to_action', 'type' => 'text', )); $wp_customize->add_setting('first_btn_text', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('first_btn_text', array( 'label' => __('First Button Text', 'blocal'), 'settings' => 'first_btn_text', 'section' => 'call_to_action', 'type' => 'text', )); $wp_customize->add_setting('first_btn_link', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('first_btn_link', array( 'label' => __('First Button Link', 'blocal'), 'settings' => 'first_btn_link', 'section' => 'call_to_action', 'type' => 'text', )); /* Second call to action button options */ $wp_customize->add_setting('second_btn_icon', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('second_btn_icon', array( 'label' => __('Second Button Icon', 'blocal'), 'settings' => 'second_btn_icon', 'section' => 'call_to_action', 'type' => 'text', )); $wp_customize->add_setting('second_btn_text', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('second_btn_text', array( 'label' => __('Second Button Text', 'blocal'), 'settings' => 'second_btn_text', 'section' => 'call_to_action', 'type' => 'text', )); $wp_customize->add_setting('second_btn_link', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('second_btn_link', array( 'label' => __('Second Button Link', 'blocal'), 'settings' => 'second_btn_link', 'section' => 'call_to_action', 'type' => 'text', )); /* Third call to action button options */ $wp_customize->add_setting('third_btn_icon', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('third_btn_icon', array( 'label' => __('Third Button Icon', 'blocal'), 'settings' => 'third_btn_icon', 'section' => 'call_to_action', 'type' => 'text', )); $wp_customize->add_setting('third_btn_text', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('third_btn_text', array( 'label' => __('Third Button Text', 'blocal'), 'settings' => 'third_btn_text', 'section' => 'call_to_action', 'type' => 'text', )); $wp_customize->add_setting('third_btn_link', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('third_btn_link', array( 'label' => __('Third Button Link', 'blocal'), 'settings' => 'third_btn_link', 'section' => 'call_to_action', 'type' => 'text', )); // =========================================== // ========== Service Area Settings ========== // =========================================== $wp_customize->add_panel( 'service_area', array( 'priority' => 18, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Service Area', 'blocal'), 'description' => '', ) ); /* Service Area On/Off Settings */ $wp_customize->add_section('service_area_on_off_section', array( 'title' => __('Service Area On/Off', 'blocal'), 'priority' => 21, 'panel' => 'service_area' )); $wp_customize->add_setting('service_area_on_off', array( 'default' => 'on', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_choices' )); $wp_customize->add_control('service_area_on_off', array( 'label' => __('Service Area On/Off', 'blocal'), 'section' => 'service_area_on_off_section', 'settings' => 'service_area_on_off', 'type' => 'radio', 'choices' => array( 'on' => 'On', 'off' => 'Off', ), )); /* Section to choose show Icon or Image on serviceArea*/ $wp_customize->add_section('serviceArea_icon_or_image', array( 'title' => __('Service Area Settings', 'blocal'), 'priority' => 21, 'panel' => 'service_area', )); $wp_customize->add_setting( 'serviceArea_icon_image', array( 'default' => 'icon', 'sanitize_callback' => 'blocal_sanitize_choices' ) ); $wp_customize->add_control( 'serviceArea_icon_image', array( 'label' => 'Choose to Show on ServiceArea', 'section' => 'serviceArea_icon_or_image', 'settings' => 'serviceArea_icon_image', 'type' => 'radio', 'choices' => array( 'icon' => 'Icon', 'image' => 'Image', ), ) ); $wp_customize->add_setting('title_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('title_serviceArea', array( 'label' => __('Service Area Title', 'blocal'), 'settings' => 'title_serviceArea', 'section' => 'serviceArea_icon_or_image', 'type' => 'textarea', )); $wp_customize->add_setting('subtitle_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('subtitle_serviceArea', array( 'label' => __('Service Area Description', 'blocal'), 'settings' => 'subtitle_serviceArea', 'section' => 'serviceArea_icon_or_image', 'type' => 'textarea', )); /* First Column Settings */ $wp_customize->add_section('first_column_section', array( 'title' => __('First Column', 'blocal'), 'priority' => 21, 'panel' => 'service_area', )); $wp_customize->add_setting('first_icon_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('first_icon_serviceArea', array( 'label' => __('First Icon', 'blocal'), 'settings' => 'first_icon_serviceArea', 'section' => 'first_column_section', 'type' => 'text', 'active_callback' => 'serviceArea_icon_callback', )); $wp_customize->add_setting('first_image_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_upload' )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'first_image_serviceArea', array( 'label' => __('First Image', 'blocal'), 'section' => 'first_column_section', 'settings' => 'first_image_serviceArea', 'active_callback' => 'serviceArea_image_callback', ))); $wp_customize->add_setting('first_title_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('first_title_serviceArea', array( 'label' => __('First Title', 'blocal'), 'settings' => 'first_title_serviceArea', 'section' => 'first_column_section', 'type' => 'text', )); $wp_customize->add_setting('first_link_anchor_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', 'default' => '#', )); $wp_customize->add_control('first_link_anchor_serviceArea', array( 'label' => __('First Title Link URL', 'blocal'), 'settings' => 'first_link_anchor_serviceArea', 'section' => 'first_column_section', 'type' => 'text', )); $wp_customize->add_setting('first_desc_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('first_desc_serviceArea', array( 'label' => __('First Description', 'blocal'), 'settings' => 'first_desc_serviceArea', 'section' => 'first_column_section', 'type' => 'textarea', )); /* Second Column Settings */ $wp_customize->add_section('second_column_section', array( 'title' => __('Second Column', 'blocal'), 'priority' => 21, 'panel' => 'service_area', )); $wp_customize->add_setting('second_icon_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('second_icon_serviceArea', array( 'label' => __('Second Icon', 'blocal'), 'settings' => 'second_icon_serviceArea', 'section' => 'second_column_section', 'type' => 'text', 'active_callback' => 'serviceArea_icon_callback', )); $wp_customize->add_setting('second_image_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_upload' )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'second_image_serviceArea', array( 'label' => __('Second Image', 'blocal'), 'section' => 'second_column_section', 'settings' => 'second_image_serviceArea', 'active_callback' => 'serviceArea_image_callback', ))); $wp_customize->add_setting('second_title_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('second_title_serviceArea', array( 'label' => __('Second Title', 'blocal'), 'settings' => 'second_title_serviceArea', 'section' => 'second_column_section', 'type' => 'text', )); $wp_customize->add_setting('second_link_anchor_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', 'default' => '#', )); $wp_customize->add_control('second_link_anchor_serviceArea', array( 'label' => __('Second Title Link URL', 'blocal'), 'settings' => 'second_link_anchor_serviceArea', 'section' => 'second_column_section', 'type' => 'text', )); $wp_customize->add_setting('second_desc_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('second_desc_serviceArea', array( 'label' => __('Second Description', 'blocal'), 'settings' => 'second_desc_serviceArea', 'section' => 'second_column_section', 'type' => 'textarea', )); /* Third Column Settings */ $wp_customize->add_section('third_column_section', array( 'title' => __('Third Column', 'blocal'), 'priority' => 21, 'panel' => 'service_area', )); $wp_customize->add_setting('third_icon_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('third_icon_serviceArea', array( 'label' => __('Third Icon', 'blocal'), 'settings' => 'third_icon_serviceArea', 'section' => 'third_column_section', 'type' => 'text', 'active_callback' => 'serviceArea_icon_callback', )); $wp_customize->add_setting('third_image_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_upload' )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'third_image_serviceArea', array( 'label' => __('Third Image', 'blocal'), 'section' => 'third_column_section', 'settings' => 'third_image_serviceArea', 'active_callback' => 'serviceArea_image_callback', ))); $wp_customize->add_setting('third_title_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('third_title_serviceArea', array( 'label' => __('Third Title', 'blocal'), 'settings' => 'third_title_serviceArea', 'section' => 'third_column_section', 'type' => 'text', )); $wp_customize->add_setting('third_link_anchor_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', 'default' => '#', )); $wp_customize->add_control('third_link_anchor_serviceArea', array( 'label' => __('Third Title Link URL', 'blocal'), 'settings' => 'third_link_anchor_serviceArea', 'section' => 'third_column_section', 'type' => 'text', )); $wp_customize->add_setting('third_desc_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('third_desc_serviceArea', array( 'label' => __('Third Description', 'blocal'), 'settings' => 'third_desc_serviceArea', 'section' => 'third_column_section', 'type' => 'textarea', )); /* Fourth Column Settings */ $wp_customize->add_section('fourth_column_section', array( 'title' => __('Fourth Column', 'blocal'), 'priority' => 21, 'panel' => 'service_area', )); $wp_customize->add_setting('fourth_icon_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('fourth_icon_serviceArea', array( 'label' => __('Fourth Icon', 'blocal'), 'settings' => 'fourth_icon_serviceArea', 'section' => 'fourth_column_section', 'type' => 'text', 'active_callback' => 'serviceArea_icon_callback', )); $wp_customize->add_setting('fourth_image_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_upload' )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'fourth_image_serviceArea', array( 'label' => __('Fourth Image', 'blocal'), 'section' => 'fourth_column_section', 'settings' => 'fourth_image_serviceArea', 'active_callback' => 'serviceArea_image_callback', ))); $wp_customize->add_setting('fourth_title_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('fourth_title_serviceArea', array( 'label' => __('Fourth Title', 'blocal'), 'settings' => 'fourth_title_serviceArea', 'section' => 'fourth_column_section', 'type' => 'text', )); $wp_customize->add_setting('fourth_link_anchor_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', 'default' => '#', )); $wp_customize->add_control('fourth_link_anchor_serviceArea', array( 'label' => __('Fourth Title Link URL', 'blocal'), 'settings' => 'fourth_link_anchor_serviceArea', 'section' => 'fourth_column_section', 'type' => 'text', )); $wp_customize->add_setting('fourth_desc_serviceArea', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('fourth_desc_serviceArea', array( 'label' => __('Fourth Description', 'blocal'), 'settings' => 'fourth_desc_serviceArea', 'section' => 'fourth_column_section', 'type' => 'textarea', )); // =========================================== // ========== Testimonial Settings =========== // =========================================== $wp_customize->add_panel( 'testimonial_panel', array( 'priority' => 24, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Testimonial Area', 'blocal'), 'description' => '', ) ); /* Testimonial On/Off Settings */ $wp_customize->add_section('testimonial_on_offsection', array( 'title' => __('Testimonial On/Off', 'blocal'), 'priority' => 27, 'panel' => 'testimonial_panel' )); $wp_customize->add_setting('testimonial_on_off', array( 'default' => 'on', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_choices' )); $wp_customize->add_control('testimonial_on_off', array( 'label' => __('Testimonial On/Off', 'blocal'), 'section' => 'testimonial_on_offsection', 'settings' => 'testimonial_on_off', 'type' => 'radio', 'choices' => array( 'on' => 'On', 'off' => 'Off', ), )); /* Testimonial Parallax Image */ $wp_customize->add_section('testimonial_section', array( 'title' => __('Testimonial Heading & Description', 'blocal'), 'priority' => 27, 'panel' => 'testimonial_panel', )); $wp_customize->add_setting('testimonial_heading', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea', 'default' => 'What our customers say about us' )); $wp_customize->add_control('testimonial_heading', array( 'label' => __('Testimonial Heading', 'blocal'), 'settings' => 'testimonial_heading', 'section' => 'testimonial_section', 'type' => 'textarea', )); $wp_customize->add_setting('testimonial_desc', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea', )); $wp_customize->add_control('testimonial_desc', array( 'label' => __('Testimonial Description', 'blocal'), 'settings' => 'testimonial_desc', 'section' => 'testimonial_section', 'type' => 'textarea', )); /* First Testimonial Settings */ $wp_customize->add_section('first_testimonial_section', array( 'title' => __('First Testimonial Options', 'blocal'), 'priority' => 27, 'panel' => 'testimonial_panel', )); $wp_customize->add_setting('first_testimonial_image', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_upload' )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'first_testimonial_image', array( 'label' => __('Client Image', 'blocal'), 'section' => 'first_testimonial_section', 'settings' => 'first_testimonial_image', ))); $wp_customize->add_setting('first_testimonial_text', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('first_testimonial_text', array( 'label' => __('Client Message', 'blocal'), 'settings' => 'first_testimonial_text', 'section' => 'first_testimonial_section', 'type' => 'textarea', )); $wp_customize->add_setting('first_testimonial_name', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('first_testimonial_name', array( 'label' => __('Client Name', 'blocal'), 'settings' => 'first_testimonial_name', 'section' => 'first_testimonial_section', 'type' => 'text', )); $wp_customize->add_setting('first_testimonial_company', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('first_testimonial_company', array( 'label' => __('Client Company', 'blocal'), 'settings' => 'first_testimonial_company', 'section' => 'first_testimonial_section', 'type' => 'text', )); /* Second Testimonial Settings */ $wp_customize->add_section('second_testimonial_section', array( 'title' => __('Second Testimonial Options', 'blocal'), 'priority' => 27, 'panel' => 'testimonial_panel', )); $wp_customize->add_setting('second_testimonial_image', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_upload' )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'second_testimonial_image', array( 'label' => __('Client Image', 'blocal'), 'section' => 'second_testimonial_section', 'settings' => 'second_testimonial_image', ))); $wp_customize->add_setting('second_testimonial_text', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('second_testimonial_text', array( 'label' => __('Client Message', 'blocal'), 'settings' => 'second_testimonial_text', 'section' => 'second_testimonial_section', 'type' => 'textarea', )); $wp_customize->add_setting('second_testimonial_name', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('second_testimonial_name', array( 'label' => __('Client Name', 'blocal'), 'settings' => 'second_testimonial_name', 'section' => 'second_testimonial_section', 'type' => 'text', )); $wp_customize->add_setting('second_testimonial_company', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('second_testimonial_company', array( 'label' => __('Client Company', 'blocal'), 'settings' => 'second_testimonial_company', 'section' => 'second_testimonial_section', 'type' => 'text', )); /* Third Testimonial Settings */ $wp_customize->add_section('third_testimonial_section', array( 'title' => __('Third Testimonial Options', 'blocal'), 'priority' => 27, 'panel' => 'testimonial_panel', )); $wp_customize->add_setting('third_testimonial_image', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_upload' )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'third_testimonial_image', array( 'label' => __('Client Image', 'blocal'), 'section' => 'third_testimonial_section', 'settings' => 'third_testimonial_image', ))); $wp_customize->add_setting('third_testimonial_text', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('third_testimonial_text', array( 'label' => __('Client Message', 'blocal'), 'settings' => 'third_testimonial_text', 'section' => 'third_testimonial_section', 'type' => 'textarea', )); $wp_customize->add_setting('third_testimonial_name', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('third_testimonial_name', array( 'label' => __('Client Name', 'blocal'), 'settings' => 'third_testimonial_name', 'section' => 'third_testimonial_section', 'type' => 'text', )); $wp_customize->add_setting('third_testimonial_company', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('third_testimonial_company', array( 'label' => __('Client Company', 'blocal'), 'settings' => 'third_testimonial_company', 'section' => 'third_testimonial_section', 'type' => 'text', )); // ============================= // ==== Blogs On HomePage ==== // ============================= $wp_customize->add_section('blog_area', array( 'title' => __('Blog Area Options', 'blocal'), 'priority' => 30, )); /* Blogs On/Off Settings */ $wp_customize->add_setting('blog_on_off', array( 'default' => 'on', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_choices' )); $wp_customize->add_control('blog_on_off', array( 'label' => __('Blog Area On/Off', 'blocal'), 'section' => 'blog_area', 'settings' => 'blog_on_off', 'type' => 'radio', 'choices' => array( 'on' => 'On', 'off' => 'Off', ), )); $wp_customize->add_setting('blog_heading', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('blog_heading', array( 'label' => __('Heading For Blogs', 'blocal'), 'settings' => 'blog_heading', 'section' => 'blog_area', 'type' => 'text', )); $wp_customize->add_setting('no_of_blogs', array( 'default' => '2', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_int' )); $wp_customize->add_control('no_of_blogs', array( 'label' => __('Number of Blogs on HomePage', 'blocal'), 'section' => 'blog_area', 'settings' => 'no_of_blogs', 'type' => 'text', )); $wp_customize->add_setting('blog_right_heading', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('blog_right_heading', array( 'label' => __('Heading For Right Section', 'blocal'), 'settings' => 'blog_right_heading', 'section' => 'blog_area', 'type' => 'text', )); $wp_customize->add_setting('blog_right_image', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_upload' )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'blog_right_image', array( 'label' => __('Image For Right Section', 'blocal'), 'section' => 'blog_area', 'settings' => 'blog_right_image', ))); $wp_customize->add_setting('blog_right_btn_text', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('blog_right_btn_text', array( 'label' => __('Text For Button', 'blocal'), 'settings' => 'blog_right_btn_text', 'section' => 'blog_area', 'type' => 'text', )); $wp_customize->add_setting('blog_right_btn_link', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('blog_right_btn_link', array( 'label' => __('Link For Button', 'blocal'), 'settings' => 'blog_right_btn_link', 'section' => 'blog_area', 'type' => 'text', )); // ============================= // ==== Footer Text Setting ==== // ============================= $wp_customize->add_section('footer_text', array( 'title' => __('Footer Text', 'blocal'), 'priority' => 33, )); $wp_customize->add_setting('footer_credits', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('footer_credits', array( 'label' => __('Footer Credit Text', 'blocal'), 'section' => 'footer_text', 'settings' => 'footer_credits', 'type' => 'textarea', )); /* ----------------------------------- */ /* ------- Custom CSS options ------- */ /* ----------------------------------- */ $wp_customize->get_section('colors')->title = esc_html__('Custom Style', 'blocal'); // theme color $wp_customize->add_setting('custom_theme_color', array( 'default' => '#40bc69', 'sanitize_callback' => 'blocal_sanitize_color', )); // add color picker control $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'custom_theme_color', array( 'label' => __('Theme Color', 'blocal'), 'section' => 'colors', 'settings' => 'custom_theme_color' ) ) ); // theme color $wp_customize->add_setting('header_footer_bg_color', array( 'default' => '#654e9c', 'sanitize_callback' => 'blocal_sanitize_color', )); // add color picker control $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_footer_bg_color', array( 'label' => __('Header and Footer Background Color', 'blocal'), 'section' => 'colors', 'settings' => 'header_footer_bg_color' ) ) ); $wp_customize->add_setting('custom_css', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blocal_sanitize_textarea' )); $wp_customize->add_control('custom_css', array( 'label' => __('Custom CSS', 'blocal'), 'section' => 'colors', 'settings' => 'custom_css', 'type' => 'textarea', )); } add_action( 'customize_register', 'blocal_customize_register' ); /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function blocal_customize_preview_js() { wp_enqueue_script( 'blocal_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true ); } add_action( 'customize_preview_init', 'blocal_customize_preview_js' ); function serviceArea_icon_callback( $control ) { if ( $control->manager->get_setting('serviceArea_icon_image')->value() == 'icon' ) { return true; } else { return false; } } function serviceArea_image_callback( $control ) { if ( $control->manager->get_setting('serviceArea_icon_image')->value() == 'image' ) { return true; } else { return false; } }