selective_refresh ) ? 'postMessage' : 'refresh'; /*========================================= CTA Section =========================================*/ $wp_customize->add_section( 'cta_setting', array( 'title' => esc_html__( 'Call to Action Section', 'artech' ), 'priority' => 6, 'panel' => 'artech_frontpage_sections', ) ); // CTA Description // $wp_customize->add_setting( 'cta_description', array( 'default' => esc_html__('Meet Our People. See Our Work. Join Our Team','artech'), 'capability' => 'edit_theme_options', 'sanitize_callback' => 'artech_sanitize_html', 'transport' => $selective_refresh, 'priority' => 6, ) ); $wp_customize->add_control( 'cta_description', array( 'label' => __('Description','artech'), 'section' => 'cta_setting', 'type' => 'textarea', ) ); // Button // $wp_customize->add_setting( 'cta_count' ,array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'artech_sanitize_text', 'priority' => 7, ) ); $wp_customize->add_control( 'cta_count', array( 'type' => 'hidden', 'label' => __('Button','artech'), 'section' => 'cta_setting', ) ); $wp_customize->add_setting( 'cta_count_title', array( 'default' => __('Contact With Us','artech'), 'capability' => 'edit_theme_options', 'sanitize_callback' => 'artech_sanitize_html', 'priority' => 9, ) ); $wp_customize->add_control( 'cta_count_title', array( 'label' => __('Count Title','artech'), 'section' => 'cta_setting', 'type' => 'text', ) ); $wp_customize->add_setting( 'cta_count_number', array( 'default' => __('Contact With Us','artech'), 'capability' => 'edit_theme_options', 'sanitize_callback' => 'artech_sanitize_html', 'priority' => 9, ) ); $wp_customize->add_control( 'cta_count_number', array( 'label' => __('Count Number','artech'), 'section' => 'cta_setting', 'type' => 'text', ) ); $wp_customize->add_setting( 'cta_count_btn_lbl', array( 'default' => __('Contact With Us','artech'), 'capability' => 'edit_theme_options', 'sanitize_callback' => 'artech_sanitize_html', 'priority' => 9, ) ); $wp_customize->add_control( 'cta_count_btn_lbl', array( 'label' => __('Count Button Label','artech'), 'section' => 'cta_setting', 'type' => 'text', ) ); $wp_customize->add_setting( 'cta_count_btn_desc', array( 'default' => __('Contact With Us','artech'), 'capability' => 'edit_theme_options', 'sanitize_callback' => 'artech_sanitize_html', 'priority' => 9, ) ); $wp_customize->add_control( 'cta_count_btn_desc', array( 'label' => __('Count Button Description','artech'), 'section' => 'cta_setting', 'type' => 'text', ) ); // CTA Background // $wp_customize->add_setting( 'cta_bg_head' ,array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'artech_sanitize_text', 'priority' => 13, ) ); $wp_customize->add_control( 'cta_bg_head', array( 'type' => 'hidden', 'label' => __('Images','artech'), 'section' => 'cta_setting', ) ); $wp_customize->add_setting( 'cta_left_img' , array( 'default' => esc_url(get_template_directory_uri() . '/assets/images/ft-1.jpg'), 'capability' => 'edit_theme_options', 'sanitize_callback' => 'artech_sanitize_url', 'priority' => 14, ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize , 'cta_left_img' , array( 'label' => __( 'Left Image', 'artech' ), 'section' => 'cta_setting', ) )); $wp_customize->add_setting( 'cta_right_img' , array( 'default' => esc_url(get_template_directory_uri() . '/assets/images/ft-1.jpg'), 'capability' => 'edit_theme_options', 'sanitize_callback' => 'artech_sanitize_url', 'priority' => 14, ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize , 'cta_right_img' , array( 'label' => __( 'Right Image', 'artech' ), 'section' => 'cta_setting', ) )); } add_action( 'customize_register', 'artech_cta_setting' ); // CTA selective refresh function artech_cta_section_partials( $wp_customize ){ // cta_title $wp_customize->selective_refresh->add_partial( 'cta_title', array( 'selector' => '.cta-section-home .cta-content h3', 'settings' => 'cta_title', 'render_callback' => 'artech_cta_title_render_callback', ) ); // cta_description $wp_customize->selective_refresh->add_partial( 'cta_description', array( 'selector' => '.cta-section-home .cta-content p', 'settings' => 'cta_description', 'render_callback' => 'artech_cta_description_render_callback', ) ); // cta_call_icon $wp_customize->selective_refresh->add_partial( 'cta_call_icon', array( 'selector' => '.cta-section-home .cta-left .widget-contact .contact-icon i', 'settings' => 'cta_call_icon', 'render_callback' => 'artech_cta_call_icon_render_callback', ) ); // cta_phone_number $wp_customize->selective_refresh->add_partial( 'cta_phone_number', array( 'selector' => '.cta-section-home .cta-left .widget-contact .contact-info p a', 'settings' => 'cta_phone_number', 'render_callback' => 'artech_cta_phone_number_render_callback', ) ); // cta_btn_lbl $wp_customize->selective_refresh->add_partial( 'cta_btn_lbl', array( 'selector' => '.cta-section-home .cta-content .main-btn', 'settings' => 'cta_btn_lbl', 'render_callback' => 'artech_cta_description_render_callback', ) ); // cta_video_url $wp_customize->selective_refresh->add_partial( 'cta_video_url', array( 'selector' => '.cta-section-home .cta-center .cta-play-btn a i', 'settings' => 'cta_video_url', 'render_callback' => 'artech_cta_video_url_render_callback', ) ); } add_action( 'customize_register', 'artech_cta_section_partials' ); // cta_title function artech_cta_title_render_callback() { return get_theme_mod( 'cta_title' ); } // cta_description function artech_cta_description_render_callback() { return get_theme_mod( 'cta_description' ); } // cta_phone_number function artech_cta_phone_number_render_callback() { return get_theme_mod( 'cta_phone_number' ); } // cta_btn_lbl function artech_cta_btn_lbl_render_callback() { return get_theme_mod( 'cta_btn_lbl' ); } // cta_video_url function artech_cta_video_url_render_callback() { return get_theme_mod( 'cta_video_url' ); }