add_section( 'section_featured_slider', array( 'title' => __( 'Slider Section', 'akisa' ), 'priority' => 10, 'capability' => 'edit_theme_options', 'panel' => 'home_page_panel', ) ); $wp_customize->add_setting( 'theme_options[disable_featured-slider_section]', array( 'default' => $default['disable_featured-slider_section'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'akisa_sanitize_switch_control', ) ); $wp_customize->add_control( new Akisa_Switch_Control( $wp_customize, 'theme_options[disable_featured-slider_section]', array( 'label' => __('Disable Slider Section', 'akisa'), 'section' => 'section_featured_slider', 'on_off_label' => akisa_switch_options(), ) ) ); // Add arrow enable setting and control. $wp_customize->add_setting( 'theme_options[slider_arrow_enable]', array( 'default' => $default['slider_arrow_enable'], 'sanitize_callback' => 'akisa_sanitize_checkbox', ) ); $wp_customize->add_control( 'theme_options[slider_arrow_enable]', array( 'label' => esc_html__( 'Enable Slider Arrow', 'akisa' ), 'section' => 'section_featured_slider', 'type' => 'checkbox', 'active_callback' => 'akisa_slider_active', ) ); // Add autoplay enable setting and control. $wp_customize->add_setting( 'theme_options[slider_autoplay_enable]', array( 'default' => $default['slider_autoplay_enable'], 'sanitize_callback' => 'akisa_sanitize_checkbox', ) ); $wp_customize->add_control( 'theme_options[slider_autoplay_enable]', array( 'label' => esc_html__( 'Enable Slider Autoplay', 'akisa' ), 'section' => 'section_featured_slider', 'type' => 'checkbox', 'active_callback' => 'akisa_slider_active', ) ); // Add autoplay enable setting and control. $wp_customize->add_setting( 'theme_options[slider_fade_enable]', array( 'default' => $default['slider_fade_enable'], 'sanitize_callback' => 'akisa_sanitize_checkbox', ) ); $wp_customize->add_control( 'theme_options[slider_fade_enable]', array( 'label' => esc_html__( 'Enable Slider Fade Effect', 'akisa' ), 'section' => 'section_featured_slider', 'type' => 'checkbox', 'active_callback' => 'akisa_slider_active', ) ); // Add category enable setting and control. $wp_customize->add_setting( 'theme_options[slider_content_enable]', array( 'default' => $default['slider_content_enable'], 'sanitize_callback' => 'akisa_sanitize_checkbox', ) ); $wp_customize->add_control( 'theme_options[slider_content_enable]', array( 'label' => esc_html__( 'Enable Content', 'akisa' ), 'section' => 'section_featured_slider', 'type' => 'checkbox', 'active_callback' => 'akisa_slider_active', ) ); // Number of items $wp_customize->add_setting('theme_options[slider_speed]', array( 'default' => $default['slider_speed'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'akisa_sanitize_number_range' ) ); $wp_customize->add_control('theme_options[slider_speed]', array( 'label' => __('Slider Speed', 'akisa'), 'description' => __('Slider Speed Default speed 800', 'akisa'), 'section' => 'section_featured_slider', 'settings' => 'theme_options[slider_speed]', 'type' => 'number', 'active_callback' => 'akisa_slider_active', ) ); $wp_customize->add_setting( 'theme_options[slider_dot]', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'akisa_sanitize_switch_control', ) ); $wp_customize->add_control( new Akisa_Switch_Control( $wp_customize, 'theme_options[slider_dot]', array( 'label' => __('Disable Slider Dots', 'akisa'), 'section' => 'section_featured_slider', 'on_off_label' => akisa_switch_options(), 'active_callback' => 'akisa_slider_active', ) ) ); $wp_customize->add_setting( 'theme_options[disable_white_overlay]', array( 'default' => $default['disable_white_overlay'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'akisa_sanitize_switch_control', ) ); $wp_customize->add_control( new Akisa_Switch_Control( $wp_customize, 'theme_options[disable_white_overlay]', array( 'label' => __('Disable White overlay and enable image overlay', 'akisa'), 'section' => 'section_featured_slider', 'on_off_label' => akisa_switch_options(), 'active_callback' => 'akisa_slider_active', ) ) ); // Number of items $wp_customize->add_setting('theme_options[number_of_sr_items]', array( 'default' => $default['number_of_sr_items'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'akisa_sanitize_number_range' ) ); $wp_customize->add_control('theme_options[number_of_sr_items]', array( 'label' => __('Number Of Slides', 'akisa'), 'description' => __('Save & Refresh the customizer to see its effect. Maximum is 24(Pro).', 'akisa'), 'section' => 'section_featured_slider', 'settings' => 'theme_options[number_of_sr_items]', 'type' => 'number', 'active_callback' => 'akisa_slider_active', 'input_attrs' => array( 'min' => 1, 'max' => 3, 'step' => 1, ), ) ); $number_of_sr_items = akisa_get_option( 'number_of_sr_items' ); for( $i=1; $i<=$number_of_sr_items; $i++ ){ // Additional Information First Page $wp_customize->add_setting('theme_options[slider_after_title_'.$i.']', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control('theme_options[slider_after_title_'.$i.']', array( 'label' => sprintf( __('After Title #%1$s', 'akisa'), $i), 'section' => 'section_featured_slider', 'settings' => 'theme_options[slider_after_title_'.$i.']', 'type' => 'text', 'active_callback' => 'akisa_slider_active', ) ); // Additional Information First Post $wp_customize->add_setting('theme_options[slider_post_'.$i.']', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'akisa_dropdown_posts' ) ); $wp_customize->add_control( new Akisa_Dropdown_Chooser( $wp_customize,'theme_options[slider_post_'.$i.']', array( 'label' => sprintf( __('Select Post #%1$s', 'akisa'), $i), 'section' => 'section_featured_slider', 'settings' => 'theme_options[slider_post_'.$i.']', 'choices' => akisa_post_choices(), 'type' => 'dropdown-posts', 'active_callback' => 'akisa_slider_active', ) )); // Cta Button Text $wp_customize->add_setting('theme_options[slider_custom_btn_text_' . $i . ']', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control('theme_options[slider_custom_btn_text_' . $i . ']', array( 'label' => sprintf( __('Button Label %d', 'akisa'),$i ), 'section' => 'section_featured_slider', 'settings' => 'theme_options[slider_custom_btn_text_' . $i . ']', 'active_callback' => 'akisa_slider_active', 'type' => 'text', ) ); // slider hr setting and control $wp_customize->add_setting( 'theme_options[slider_hr_'. $i .']', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( new Akisa_Customize_Horizontal_Line( $wp_customize, 'theme_options[slider_hr_'. $i .']', array( 'section' => 'section_featured_slider', 'active_callback' => 'akisa_slider_active', 'type' => 'hr', ) ) ); } // Slider Button Text $wp_customize->add_setting('theme_options[slider_alt_custom_btn_text]', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control('theme_options[slider_alt_custom_btn_text]', array( 'label' => __('Alternative Button Label', 'akisa'), 'section' => 'section_featured_slider', 'settings' => 'theme_options[slider_alt_custom_btn_text]', 'active_callback' => 'akisa_slider_active', 'type' => 'text', ) ); // Slider Button Url $wp_customize->add_setting('theme_options[slider_alt_custom_btn_url]', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control('theme_options[slider_alt_custom_btn_url]', array( 'label' => __('Alternative Button Url', 'akisa'), 'section' => 'section_featured_slider', 'settings' => 'theme_options[slider_alt_custom_btn_url]', 'active_callback' => 'akisa_slider_active', 'type' => 'url', ) ); $wp_customize->add_setting( 'theme_options[disable_blog_banner_section]', array( 'default' => $default['disable_blog_banner_section'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'akisa_sanitize_switch_control', ) ); $wp_customize->add_control( new Akisa_Switch_Control( $wp_customize, 'theme_options[disable_blog_banner_section]', array( 'label' => __('Disable Blog Header Section', 'akisa'), 'description' => __('If you want only header image then disable featured slider and actiove this option.This option works on Latest Posts choosen as Homepage setting', 'akisa'), 'section' => 'section_featured_slider', 'on_off_label' => akisa_switch_options(), ) ) );