get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; } add_action( 'customize_register', 'fitness_one_customize_register' ); /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function fitness_one_customize_preview_js() { wp_enqueue_script( 'fitness-one-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20151215', true ); } add_action( 'customize_preview_init', 'fitness_one_customize_preview_js' ); function fitness_one_sanitize_text( $input ) { return wp_kses_post( force_balance_tags( $input ) ); } function fitness_one_sanitize_category($input){ $output=absint($input); return $output; } function fitness_one_sanitize_html( $input ) { return wp_filter_post_kses( $input ); } function fitness_one_sanitize_checkbox( $checked ) { return ( ( isset( $checked ) && true == $checked ) ? true : false ); } function fitness_one_sanitize_image( $image, $setting ) { $mimes = array( 'jpg|jpeg|jpe' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png', 'bmp' => 'image/bmp', 'tif|tiff' => 'image/tiff', 'ico' => 'image/x-icon' ); $file = wp_check_filetype( $image, $mimes ); return ( $file['ext'] ? $image : $setting->default ); } function fitness_one_sanitize_select( $input, $setting ) { $input = sanitize_key( $input ); $choices = $setting->manager->get_control( $setting->id )->choices; return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); } function fitness_one_sanitize_dropdown_pages( $page_id, $setting ) { // Ensure $input is an absolute integer. $page_id = absint( $page_id ); // If $page_id is an ID of a published page, return it; otherwise, return the default. return ( 'publish' == get_post_status( $page_id ) ? $page_id : $setting->default ); } function fitness_one_customizer_register( $wp_customize ) { $wp_customize->add_panel( 'theme_option', array( 'priority' => 220, 'title' => esc_html(__( 'Fitness One Theme Option', 'fitness-one')), 'description' => esc_html(__( 'Fitness One Theme Option Panel', 'fitness-one')), )); /**********************************************/ /************* MAIN SLIDER SECTION *************/ /**********************************************/ $wp_customize->add_section('main_slider_category',array( 'priority' => 20, 'title' => esc_html(__('Slider Categories','fitness-one')), 'description' => esc_html(__('Select the Slide Category for Frontpage.','fitness-one')), 'panel' => 'theme_option' )); $wp_customize->add_setting( 'section_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Home','fitness-one')) ) ); $wp_customize->add_control( 'section_title', array( 'label' => esc_html(__('Section Menu Title','fitness-one')), 'section' => 'main_slider_category', 'settings' => 'section_title', 'type' => 'text', ) ); $wp_customize->add_setting('slider_category_display',array( 'sanitize_callback' => 'fitness_one_sanitize_category', 'default' => '0' )); $wp_customize->add_control(new fitness_one_Customize_Dropdown_Taxonomies_Control($wp_customize,'slider_category_display',array( 'label' => esc_html(__('Choose category','fitness-one')), 'section' => 'main_slider_category', 'settings' => 'slider_category_display', 'type'=> 'dropdown-taxonomies', ) )); // enable/disable slider $wp_customize->add_setting( 'slider_disable', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fitness_one_sanitize_select', 'default' =>'0', ) ); $wp_customize->add_control( 'slider_disable', array( 'label' => esc_html(__( 'Check to disable Slider', 'fitness-one')), 'section' => 'main_slider_category', 'settings' => 'slider_disable', 'type' => 'radio', 'choices' => array( '0' => esc_html(__('Disable','fitness-one')), '1' => esc_html(__('Enable','fitness-one')), ), ) ); // no of posts to show on slider $wp_customize->add_setting( 'slider_no_of_posts', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fitness_one_sanitize_select', 'default' => esc_html(__('3','fitness-one')), ) ); $wp_customize->add_control( 'slider_no_of_posts', array( 'settings' => 'slider_no_of_posts', 'label' => esc_html(__( 'No Of Posts To Show On Slider', 'fitness-one')), 'section' => 'main_slider_category', 'type' => 'select', 'choices' => array( '1' => esc_html(__( '1', 'fitness-one')), '2' => esc_html(__( '2 ', 'fitness-one')), '3' => esc_html(__( '3', 'fitness-one')) ), 'priority' => 20 ) ); // enable/disable slider $wp_customize->add_setting( 'readmore_slider_disable', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fitness_one_sanitize_select', 'default' =>'0', ) ); $wp_customize->add_control( 'readmore_slider_disable', array( 'label' => esc_html(__( 'Enable/Disable Readmore Button', 'fitness-one')), 'section' => 'main_slider_category', 'settings' => 'readmore_slider_disable', 'type' => 'radio', 'choices' => array( '0' => esc_html(__('Disable','fitness-one')), '1' => esc_html(__('Enable','fitness-one')), ), ) ); $wp_customize->add_setting( 'section_readmore_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Read More','fitness-one')) ) ); $wp_customize->add_control( 'section_readmore_title', array( 'label' => esc_html(__('Slider Read More Title','fitness-one')), 'section' => 'main_slider_category', 'settings' => 'section_readmore_title', 'type' => 'text', ) ); $wp_customize->add_setting( 'section_Button_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Services','fitness-one')) ) ); $wp_customize->add_control( 'section_Button_title', array( 'label' => esc_html(__('Slider Button Title','fitness-one')), 'section' => 'main_slider_category', 'settings' => 'section_Button_title', 'type' => 'text', ) ); $wp_customize->add_setting( 'section_Button_link', array( 'sanitize_callback' => 'esc_url_raw', 'default' => esc_html(__('#','fitness-one')) ) ); $wp_customize->add_control( 'section_Button_link', array( 'label' => esc_html(__('Slider Button Link','fitness-one')), 'section' => 'main_slider_category', 'settings' => 'section_Button_link', 'type' => 'url', ) ); /**********************************************/ /************* ABOUT SECTION *************/ /**********************************************/ $wp_customize->add_section('about_section',array( 'priority' => 20, 'title' => esc_html(__('About Section','fitness-one')), 'description' => esc_html(__('About Us Section','fitness-one')), 'panel' => 'theme_option' )); $wp_customize->add_setting( 'about_menu_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('About','fitness-one')) ) ); $wp_customize->add_control( 'about_menu_title', array( 'label' => esc_html(__('Section Menu Title','fitness-one')), 'section' => 'about_section', 'settings' => 'about_menu_title', 'type' => 'text', ) ); $wp_customize->add_setting( 'about_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('About Us','fitness-one')) ) ); $wp_customize->add_control( 'about_title', array( 'label' => esc_html(__('Section Title','fitness-one')), 'section' => 'about_section', 'settings' => 'about_title', 'type' => 'text', ) ); $wp_customize->add_setting( 'about_text', array( 'sanitize_callback' => 'sanitize_text_field', 'default' =>'' ) ); $wp_customize->add_control( 'about_text', array( 'label' => esc_html(__('Section Text','fitness-one')), 'section' => 'about_section', 'settings' => 'about_text', 'type' => 'text', ) ); $wp_customize->add_setting( 'about_icon', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('fa fa-laptop','fitness-one')), 'description'=> esc_html(__('Use font-awesome class','fitness-one')) ) ); $wp_customize->add_control( 'about_icon', array( 'label' => esc_html(__('Section Icon','fitness-one')), 'section' => 'about_section', 'settings' => 'about_icon', 'type' => 'text', ) ); $wp_customize->add_setting('about_category_display',array( 'sanitize_callback' => 'fitness_one_sanitize_category', 'default' => '0' )); $wp_customize->add_control(new fitness_one_Customize_Dropdown_Taxonomies_Control($wp_customize,'about_category_display',array( 'label' => esc_html(__('Choose category','fitness-one')), 'section' => 'about_section', 'settings' => 'about_category_display', 'type'=> 'dropdown-taxonomies', ) )); // no of posts to show on slider $wp_customize->add_setting( 'about_no_of_posts', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fitness_one_sanitize_select', 'default' => esc_html(__('4','fitness-one')), ) ); $wp_customize->add_control( 'about_no_of_posts', array( 'settings' => 'about_no_of_posts', 'label' => esc_html(__( 'No Of Posts To Show On About', 'fitness-one')), 'section' => 'about_section', 'type' => 'select', 'choices' => array( '0' => esc_html(_X( '0', 'fitness-one')), '2' => esc_html(__( '2', 'fitness-one')), '3' => esc_html(__( '3 ', 'fitness-one')), '4' => esc_html(__( '4', 'fitness-one')), ), 'priority' => 20 ) ); // enable/disable slider $wp_customize->add_setting( 'about_disable', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fitness_one_sanitize_select', 'default' =>'1', ) ); $wp_customize->add_control( 'about_disable', array( 'label' => esc_html(__( 'Check to disable About Section', 'fitness-one')), 'section' => 'about_section', 'settings' => 'about_disable', 'type' => 'radio', 'choices' => array( '0' => esc_html(__('Disable','fitness-one')), '1' => esc_html(__('Enable','fitness-one')), ), ) ); /**********************************************/ /************* ABOUT TIMER SECTION *************/ /**********************************************/ $wp_customize->add_section('about_timer_section',array( 'priority' => 20, 'title' => esc_html(__('About Timer Section','fitness-one')), 'description' => esc_html(__('About Timer Section Value','fitness-one')), 'panel' => 'theme_option' )); // enable/disable slider $wp_customize->add_setting( 'about_timer_disable', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fitness_one_sanitize_select', 'default' =>'1', ) ); $wp_customize->add_control( 'about_timer_disable', array( 'label' => esc_html(__( 'Check to disable About Timer Section', 'fitness-one')), 'section' => 'about_timer_section', 'settings' => 'about_timer_disable', 'type' => 'radio', 'choices' => array( '0' => esc_html(__('Disable','fitness-one')), '1' => esc_html(__('Enable','fitness-one')), ), ) ); for ( $i = 1; $i <= 4; $i++ ) { $wp_customize->add_setting('fitness_one_counter'.$i,array( 'sanitize_callback' => 'sanitize_text_field', 'default'=> '323'.$i, )); $wp_customize->add_control('fitness_one_counter'.$i,array( 'label' => esc_html(__('fitness-one Counter' ,'fitness-one')).$i, 'section' => 'about_timer_section', 'settings' => 'fitness_one_counter'.$i, 'type' => 'text' )); $wp_customize->add_setting('fitness_one_title'.$i,array( 'sanitize_callback' => 'sanitize_text_field', 'default'=> esc_html(__('Design And Developers','fitness-one')).$i, )); $wp_customize->add_control('fitness_one_title'.$i,array( 'label' => esc_html(__('fitness-one About Timer Title' ,'fitness-one')).$i, 'section' => 'about_timer_section', 'settings' => 'fitness_one_title'.$i, 'type' => 'text' )); } $wp_customize->add_setting('timer_background', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fitness_one_sanitize_image' )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'timer_background', array( 'label' => esc_html(__('Upload Background Image For Service Section', 'fitness-one')), 'section' => 'about_timer_section', 'setting' => 'timer_background', 'priority' => 20 ))); /**********************************************/ /************* SERVICES SECTION *************/ /**********************************************/ $wp_customize->add_section('service_section',array( 'priority' => 20, 'title' => esc_html(__('Services Section','fitness-one')), 'description' => esc_html(__('Service Section Values','fitness-one')), 'panel' => 'theme_option' )); $wp_customize->add_setting( 'service_menu_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Services','fitness-one')) ) ); $wp_customize->add_control( 'service_menu_title', array( 'label' => esc_html(__('Section Menu Title','fitness-one')), 'section' => 'service_section', 'settings' => 'service_menu_title', 'type' => 'text', ) ); $wp_customize->add_setting( 'service_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Services ','fitness-one')) ) ); $wp_customize->add_control( 'service_title', array( 'label' => esc_html(__('Section Title','fitness-one')), 'section' => 'service_section', 'settings' => 'service_title', 'type' => 'text', ) ); $wp_customize->add_setting( 'service_text', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( 'service_text', array( 'label' => esc_html(__('Section Subtitle','fitness-one')), 'section' => 'service_section', 'settings' => 'service_text', 'type' => 'text', ) ); $wp_customize->add_setting( 'service_icon', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('fa fa-laptop','fitness-one')), 'description'=> esc_html(__('Use font-awesome class','fitness-one')) ) ); $wp_customize->add_control( 'service_icon', array( 'label' => esc_html(__('Section Icon','fitness-one')), 'section' => 'service_section', 'settings' => 'service_icon', 'type' => 'text', ) ); $wp_customize->add_setting('service_category_display',array( 'sanitize_callback' => 'fitness_one_sanitize_category', 'default' => '0' )); $wp_customize->add_control(new fitness_one_Customize_Dropdown_Taxonomies_Control($wp_customize,'service_category_display',array( 'label' => esc_html(__('Choose category','fitness-one')), 'section' => 'service_section', 'settings' => 'service_category_display', 'type'=> 'dropdown-taxonomies', ) )); // enable/disable slider $wp_customize->add_setting( 'service_disable', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fitness_one_sanitize_select', 'default' =>'1', ) ); $wp_customize->add_control( 'service_disable', array( 'label' => esc_html(__( 'Check to disable Services Section', 'fitness-one')), 'section' => 'service_section', 'settings' => 'service_disable', 'type' => 'radio', 'choices' => array( '0' => esc_html(__('Disable','fitness-one')), '1' => esc_html(__('Enable','fitness-one')), ), ) ); // no of posts to show on slider $wp_customize->add_setting( 'service_no_of_posts', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fitness_one_sanitize_select', 'default' => esc_html(__('3','fitness-one')), ) ); $wp_customize->add_control( 'service_no_of_posts', array( 'settings' => 'service_no_of_posts', 'label' => esc_html(__( 'No Of Posts To Show On Services', 'fitness-one')), 'section' => 'service_section', 'type' => 'select', 'choices' => array( '0' => esc_html(_X( '0', 'fitness-one')), '3' => esc_html(__( '3', 'fitness-one')), '6' => esc_html(__( '6 ', 'fitness-one')), '9' => esc_html(__( '9', 'fitness-one')), ), 'priority' => 20 ) ); /**********************************************/ /************* CTA SECTION *************/ /**********************************************/ $wp_customize->add_section('cta_section',array( 'priority' => 20, 'title' => esc_html(__('CTA Section','fitness-one')), 'description' => esc_html(__('Call To Action Section','fitness-one')), 'panel' => 'theme_option' )); $wp_customize->add_setting( 'cta_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('READY TO WORK? ','fitness-one')) ) ); $wp_customize->add_control( 'cta_title', array( 'label' => esc_html(__('Section Title','fitness-one')), 'section' => 'cta_section', 'settings' => 'cta_title', 'type' => 'text', ) ); $wp_customize->add_setting( 'cta_text', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Section Subtitle','fitness-one')) ) ); $wp_customize->add_control( 'cta_text', array( 'label' => esc_html(__('Section Text','fitness-one')), 'section' => 'cta_section', 'settings' => 'cta_text', 'type' => 'text', ) ); $wp_customize->add_setting( 'cta_button_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Button ','fitness-one')) ) ); $wp_customize->add_control( 'cta_button_title', array( 'label' => esc_html(__('Button Title','fitness-one')), 'section' => 'cta_section', 'settings' => 'cta_button_title', 'type' => 'text', ) ); $wp_customize->add_setting( 'cta_button_link', array( 'sanitize_callback' => 'esc_url_raw', 'default' => esc_html(__('#','fitness-one')) ) ); $wp_customize->add_control( 'cta_button_link', array( 'label' => esc_html(__('Button Link','fitness-one')), 'section' => 'cta_section', 'settings' => 'cta_button_link', 'type' => 'text', ) ); // enable/disable slider $wp_customize->add_setting( 'cta_disable', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fitness_one_sanitize_select', 'default' =>'1', ) ); $wp_customize->add_control( 'cta_disable', array( 'label' => esc_html(__( 'Check to disable CTA Section', 'fitness-one')), 'section' => 'cta_section', 'settings' => 'cta_disable', 'type' => 'radio', 'choices' => array( '0' => esc_html(__('Disable','fitness-one')), '1' => esc_html(__('Enable','fitness-one')), ), ) ); $wp_customize->add_setting('cta_background', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fitness_one_sanitize_image' )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'cta_background', array( 'label' => esc_html(__('Upload Background Image For CTA Section', 'fitness-one')), 'section' => 'cta_section', 'setting' => 'cta_background', 'priority' => 20 ))); /**********************************************/ /************* PORTFOLIO SECTION *************/ /**********************************************/ $wp_customize->add_section('portfolio_section',array( 'priority' => 20, 'title' => esc_html(__('Portfolio Section','fitness-one')), 'description' => esc_html(__('Portfolio Section','fitness-one')), 'panel' => 'theme_option' )); $wp_customize->add_setting( 'portfolio_menu_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Portfolio','fitness-one')) ) ); $wp_customize->add_control( 'portfolio_menu_title', array( 'label' => esc_html(__('Section Menu Title','fitness-one')), 'section' => 'portfolio_section', 'settings' => 'portfolio_menu_title', 'type' => 'text', ) ); $wp_customize->add_setting( 'portfolio_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Portfolio ','fitness-one')) ) ); $wp_customize->add_control( 'portfolio_title', array( 'label' => esc_html(__('Section Title','fitness-one')), 'section' => 'portfolio_section', 'settings' => 'portfolio_title', 'type' => 'text', ) ); $wp_customize->add_setting( 'portfolio_text', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Section Subtitle','fitness-one')) ) ); $wp_customize->add_control( 'portfolio_text', array( 'label' => esc_html(__('Section Subtitle','fitness-one')), 'section' => 'portfolio_section', 'settings' => 'portfolio_text', 'type' => 'text', ) ); $wp_customize->add_setting('portfolio_category_display',array( 'sanitize_callback' => 'fitness_one_sanitize_category', 'default' => '0' )); $wp_customize->add_control(new fitness_one_Customize_Dropdown_Taxonomies_Control($wp_customize,'portfolio_category_display',array( 'label' => esc_html(__('Choose category','fitness-one')), 'section' => 'portfolio_section', 'settings' => 'portfolio_category_display', 'type'=> 'dropdown-taxonomies', ) )); // enable/disable slider $wp_customize->add_setting( 'portfolio_disable', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fitness_one_sanitize_select', 'default' =>'1', ) ); $wp_customize->add_control( 'portfolio_disable', array( 'label' => esc_html(__( 'Check to disable Portfolio Section', 'fitness-one')), 'section' => 'portfolio_section', 'settings' => 'portfolio_disable', 'type' => 'radio', 'choices' => array( '0' => esc_html(__('Disable','fitness-one')), '1' => esc_html(__('Enable','fitness-one')), ), ) ); /**********************************************/ /************* TEAM SECTION *************/ /**********************************************/ $wp_customize->add_section('team_section',array( 'priority' => 20, 'title' => esc_html(__('Team Section','fitness-one')), 'description' => esc_html(__('Team Section','fitness-one')), 'panel' => 'theme_option' )); $wp_customize->add_setting( 'team_menu_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Team','fitness-one')) ) ); $wp_customize->add_control( 'team_menu_title', array( 'label' => esc_html(__('Section Menu Title','fitness-one')), 'section' => 'team_section', 'settings' => 'team_menu_title', 'type' => 'text', ) ); $wp_customize->add_setting( 'team_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Team ','fitness-one')) ) ); $wp_customize->add_control( 'team_title', array( 'label' => esc_html(__('Section Title','fitness-one')), 'section' => 'team_section', 'settings' => 'team_title', 'type' => 'text', ) ); $wp_customize->add_setting( 'team_text', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Section Subtitle','fitness-one')) ) ); $wp_customize->add_control( 'team_text', array( 'label' => esc_html(__('Section text','fitness-one')), 'section' => 'team_section', 'settings' => 'team_text', 'type' => 'text', ) ); $wp_customize->add_setting('team_category_display',array( 'sanitize_callback' => 'fitness_one_sanitize_category', 'default' => '0' )); $wp_customize->add_control(new fitness_one_Customize_Dropdown_Taxonomies_Control($wp_customize,'team_category_display',array( 'label' => esc_html(__('Choose category','fitness-one')), 'section' => 'team_section', 'settings' => 'team_category_display', 'type'=> 'dropdown-taxonomies', ) )); // enable/disable slider $wp_customize->add_setting( 'team_disable', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fitness_one_sanitize_select', 'default' =>'1', ) ); $wp_customize->add_control( 'team_disable', array( 'label' => esc_html(__( 'Check to disable Team Section', 'fitness-one')), 'section' => 'team_section', 'settings' => 'team_disable', 'type' => 'radio', 'choices' => array( '0' => esc_html(__('Disable','fitness-one')), '1' => esc_html(__('Enable','fitness-one')), ), ) ); // no of posts to show on slider $wp_customize->add_setting( 'team_no_of_posts', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fitness_one_sanitize_select', 'default' => esc_html(__('5','fitness-one')), ) ); $wp_customize->add_control( 'team_no_of_posts', array( 'settings' => 'team_no_of_posts', 'label' => esc_html(__( 'No Of Posts To Show On Team', 'fitness-one')), 'section' => 'team_section', 'type' => 'select', 'choices' => array( '0' => esc_html(_X( '0', 'fitness-one')), '5' => esc_html(__( '5', 'fitness-one')), '10' => esc_html(__( '10 ', 'fitness-one')), '15' => esc_html(__( '15', 'fitness-one')), ), 'priority' => 20 ) ); /**********************************************/ /************* PRICING SECTION *************/ /**********************************************/ $wp_customize->add_section('pricing_section',array( 'priority' => 20, 'title' => esc_html(__('Pricing Section','fitness-one')), 'description' => esc_html(__('This section is related to widget, If you enable this section then manage it Using fitness-one Pricing Widget.','fitness-one')), 'panel' => 'theme_option' )); $wp_customize->add_setting( 'pricing_menu_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Pricing','fitness-one')) ) ); $wp_customize->add_control( 'pricing_menu_title', array( 'label' => esc_html(__('Section Menu Title','fitness-one')), 'section' => 'pricing_section', 'settings' => 'pricing_menu_title', 'type' => 'text', ) ); $wp_customize->add_setting( 'pricing_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Pricing ','fitness-one')) ) ); $wp_customize->add_control( 'pricing_title', array( 'label' => esc_html(__('Section Title','fitness-one')), 'section' => 'pricing_section', 'settings' => 'pricing_title', 'type' => 'text', ) ); $wp_customize->add_setting( 'pricing_text', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( 'pricing_text', array( 'label' => esc_html(__('Section Content','fitness-one')), 'section' => 'pricing_section', 'settings' => 'pricing_text', 'type' => 'text', ) ); // enable/disable slider $wp_customize->add_setting( 'pricing_disable', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fitness_one_sanitize_select', 'default' =>'1', ) ); $wp_customize->add_control( 'pricing_disable', array( 'label' => esc_html(__( 'Check to disable Pricing Section', 'fitness-one')), 'section' => 'pricing_section', 'settings' => 'pricing_disable', 'type' => 'radio', 'choices' => array( '0' => esc_html(__('Disable','fitness-one')), '1' => esc_html(__('Enable','fitness-one')), ), ) ); $wp_customize->add_setting('pricing_background', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fitness_one_sanitize_image' )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'pricing_background', array( 'label' => esc_html(__('Upload Background Image For Service Section', 'fitness-one')), 'section' => 'pricing_section', 'setting' => 'pricing_background', 'priority' => 20 ))); /**********************************************/ /************* BLOG SECTION *************/ /**********************************************/ $wp_customize->add_section('blog_section',array( 'priority' => 20, 'title' => esc_html(__('Blog Section','fitness-one')), 'description' => esc_html(__('Blog Section','fitness-one')), 'panel' => 'theme_option' )); $wp_customize->add_setting( 'blog_menu_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Blog','fitness-one')) ) ); $wp_customize->add_control( 'blog_menu_title', array( 'label' => esc_html(__('Section Menu Title','fitness-one')), 'section' => 'blog_section', 'settings' => 'blog_menu_title', 'type' => 'text', ) ); $wp_customize->add_setting( 'blog_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Blog ','fitness-one')) ) ); $wp_customize->add_control( 'blog_title', array( 'label' => esc_html(__('Section Title','fitness-one')), 'section' => 'blog_section', 'settings' => 'blog_title', 'type' => 'text', ) ); $wp_customize->add_setting('blog_category_display',array( 'sanitize_callback' => 'fitness_one_sanitize_category', 'default' => '0' )); $wp_customize->add_control(new fitness_one_Customize_Dropdown_Taxonomies_Control($wp_customize,'blog_category_display',array( 'label' => esc_html(__('Choose category','fitness-one')), 'section' => 'blog_section', 'settings' => 'blog_category_display', 'type'=> 'dropdown-taxonomies', ) )); // enable/disable slider $wp_customize->add_setting( 'blog_disable', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fitness_one_sanitize_select', 'default' =>'1', ) ); $wp_customize->add_control( 'blog_disable', array( 'label' => esc_html(__( 'Check to disable Blog Section', 'fitness-one')), 'section' => 'blog_section', 'settings' => 'blog_disable', 'type' => 'radio', 'choices' => array( '0' => esc_html(__('Disable','fitness-one')), '1' => esc_html(__('Enable','fitness-one')), ), ) ); // no of posts to show on slider $wp_customize->add_setting( 'blog_no_of_posts', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fitness_one_sanitize_select', 'default' => esc_html(__('4','fitness-one')), ) ); $wp_customize->add_control( 'blog_no_of_posts', array( 'settings' => 'blog_no_of_posts', 'label' => esc_html(__( 'No Of Posts To Show On Blog', 'fitness-one')), 'section' => 'blog_section', 'type' => 'select', 'choices' => array( '0' => esc_html(_X( '0', 'fitness-one')), '4' => esc_html(__( '4', 'fitness-one')), '8' => esc_html(__( '8 ', 'fitness-one')), '12' => esc_html(__( '12', 'fitness-one')), ), 'priority' => 20 ) ); /**********************************************/ /************* NEWSLETTER SECTION *************/ /**********************************************/ $wp_customize->add_section('newsletter_section',array( 'priority' => 20, 'title' => esc_html(__('Newsletter Section ','fitness-one')), 'description' => esc_html(__('Newsletter Section','fitness-one')), 'panel' => 'theme_option' )); $wp_customize->add_setting('newsletter_background', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fitness_one_sanitize_image' )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'newsletter_background', array( 'label' => esc_html(__('Upload Background Image For Newsletter Section', 'fitness-one')), 'section' => 'newsletter_section', 'setting' => 'newsletter_background', 'priority' => 20 ))); /**********************************************/ /************* CONTACT SECTION *************/ /**********************************************/ $wp_customize->add_section('contact_section',array( 'priority' => 20, 'title' => esc_html(__('Contact Section','fitness-one')), 'description' => esc_html(__('Contact Section','fitness-one')), 'panel' => 'theme_option' )); $wp_customize->add_setting( 'contact_menu_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Contact','fitness-one')) ) ); $wp_customize->add_control( 'contact_menu_title', array( 'label' => esc_html(__('Section Title','fitness-one')), 'section' => 'contact_section', 'settings' => 'contact_menu_title', 'type' => 'text', ) ); $wp_customize->add_setting( 'contact_form', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Enter Contact Form Shortcode Here','fitness-one')) ) ); $wp_customize->add_control( 'contact_form', array( 'label' => esc_html(__(' Contact Form Shortcode','fitness-one')), 'section' => 'contact_section', 'settings' => 'contact_form', 'type' => 'text', ) ); $wp_customize->add_setting( 'contact_disable', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fitness_one_sanitize_select', 'default' =>'1', ) ); $wp_customize->add_control( 'contact_disable', array( 'label' => esc_html(__( 'Check to disable Contact Section', 'fitness-one')), 'section' => 'contact_section', 'settings' => 'contact_disable', 'type' => 'radio', 'choices' => array( '0' => esc_html(__('Disable','fitness-one')), '1' => esc_html(__('Enable','fitness-one')), ), ) ); /**********************************************/ /************* MAP SECTION *************/ /**********************************************/ $wp_customize->add_section('map_section',array( 'priority' => 20, 'title' => esc_html(__('Map Section','fitness-one')), 'description' => esc_html(__('Map Section','fitness-one')), 'panel' => 'theme_option' )); $wp_customize->add_setting( 'map_menu_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Google Map IFraming Code','fitness-one')) ) ); $wp_customize->add_control( 'map_menu_title', array( 'label' => esc_html(__('Section Title','fitness-one')), 'section' => 'map_section', 'settings' => 'map_menu_title', 'type' => 'text', ) ); $wp_customize->add_setting( 'map_iframe', array( 'sanitize_callback' => 'fitness_one_sanitize_html', 'default' => esc_html(__('Input Google Map Embeding Code Here','fitness-one')) ) ); $wp_customize->add_control( 'map_iframe', array( 'label' => esc_html(__('Map Iframe URL','fitness-one')), 'section' => 'map_section', 'settings' => 'map_iframe', 'type' => 'text', ) ); // enable/disable slider $wp_customize->add_setting( 'map_disable', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fitness_one_sanitize_select', 'default' =>'1', ) ); $wp_customize->add_control( 'map_disable', array( 'label' => esc_html(__( 'Check to disable Map Section', 'fitness-one')), 'section' => 'map_section', 'settings' => 'map_disable', 'type' => 'radio', 'choices' => array( '0' => esc_html(__('Disable','fitness-one')), '1' => esc_html(__('Enable','fitness-one')), ), ) ); /* ------ Footer Section ------ */ $wp_customize->add_section('footer_section',array( 'priority' => 40, 'title' => esc_html(__(' Footer Section','fitness-one')), 'description' => esc_html(__('Footer Section','fitness-one')), 'panel' => 'theme_option' )); /* ------ Footer Section ------ */ $wp_customize->add_setting( 'footer_logo_text', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Fitness One','fitness-one')) ) ); $wp_customize->add_control( 'footer_logo_text', array( 'label' => esc_html(__('Footer Logo Text','fitness-one')), 'section' => 'footer_section', 'settings' => 'footer_logo_text', 'type' => 'text', ) ); $wp_customize->add_setting( 'facebook_link', array( 'sanitize_callback' => 'esc_url_raw', 'default' => esc_html(__('#','fitness-one')) ) ); $wp_customize->add_control( 'facebook_link', array( 'label' => esc_html(__('Facebook link','fitness-one')), 'section' => 'footer_section', 'settings' => 'facebook_link', 'type' => 'text', ) ); $wp_customize->add_setting( 'twitter_link', array( 'sanitize_callback' => 'esc_url_raw', 'default' => esc_html(__('#','fitness-one')) ) ); $wp_customize->add_control( 'twitter_link', array( 'label' => esc_html(__('Twitter link','fitness-one')), 'section' => 'footer_section', 'settings' => 'twitter_link', 'type' => 'text', ) ); $wp_customize->add_setting( 'googleplus_link', array( 'sanitize_callback' => 'esc_url_raw', 'default' => esc_html(__('#','fitness-one')) ) ); $wp_customize->add_control( 'googleplus_link', array( 'label' => esc_html(__('Google Plus link','fitness-one')), 'section' => 'footer_section', 'settings' => 'googleplus_link', 'type' => 'text', ) ); $wp_customize->add_setting( 'instagram_link', array( 'sanitize_callback' => 'esc_url_raw', 'default' => esc_html(__('#','fitness-one')) ) ); $wp_customize->add_control( 'instagram_link', array( 'label' => esc_html(__('Instagram link','fitness-one')), 'section' => 'footer_section', 'settings' => 'instagram_link', 'type' => 'text', ) ); $wp_customize->add_setting( 'youtube_link', array( 'sanitize_callback' => 'esc_url_raw', 'default' => esc_html(__('#','fitness-one')) ) ); $wp_customize->add_control( 'youtube_link', array( 'label' => esc_html(__('Youtube link','fitness-one')), 'section' => 'footer_section', 'settings' => 'youtube_link', 'type' => 'text', ) ); $wp_customize->add_setting( 'linkedin_link', array( 'sanitize_callback' => 'esc_url_raw', 'default' => esc_html(__('#','fitness-one')) ) ); $wp_customize->add_control( 'linkedin_link', array( 'label' => esc_html(__('Linkedin link','fitness-one')), 'section' => 'footer_section', 'settings' => 'linkedin_link', 'type' => 'text', ) ); $wp_customize->add_setting( 'skype_link', array( 'sanitize_callback' => 'esc_url_raw', 'default' => esc_html(__('#','fitness-one')) ) ); $wp_customize->add_control( 'skype_link', array( 'label' => esc_html(__('Skype link','fitness-one')), 'section' => 'footer_section', 'settings' => 'skype_link', 'type' => 'text', ) ); $wp_customize->add_setting( 'copyright_text', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html(__('Copyright 2018','fitness-one')) ) ); $wp_customize->add_control( 'copyright_text', array( 'label' => esc_html(__('Copyright Text','fitness-one')), 'section' => 'footer_section', 'settings' => 'copyright_text', 'type' => 'text', ) ); $wp_customize->add_panel( 'layout', array( 'priority' => 220, 'title' => esc_html(__( 'Fitness One Sidebar Layout', 'fitness-one')), 'description' => esc_html(__( 'Fitness One Sidebar Layout', 'fitness-one')), )); $wp_customize->add_section('archive_sidebar' , array( 'priority' => 10, 'title' => esc_html(__('Archive Sidebar','fitness-one')), 'panel' => 'layout' )); $wp_customize->add_setting('archive_sidebar_position', array( 'sanitize_callback' => 'fitness_one_sanitize_select', 'default' => esc_html(__('right','fitness-one')) )); $wp_customize->add_control('archive_sidebar_position', array( 'label' => esc_html(__('Archive Sidebar position', 'fitness-one')), 'section' => 'archive_sidebar', 'settings' => 'archive_sidebar_position', 'type' => 'radio', 'choices' => array( 'none' => esc_html(__('none','fitness-one')), 'left' => esc_html(__('left','fitness-one')), 'right' => esc_html(__('right','fitness-one')), ), )); /**********************************************/ /********** SINGLE POST SIDEBAR SECTION ***********/ /**********************************************/ $wp_customize->add_section('single_post_sidebar' , array( 'priority' => 20, 'title' => esc_html(__('Single Post Sidebar','fitness-one')), 'panel' => 'layout' )); $wp_customize->add_setting('post_sidebar_position', array( 'sanitize_callback' => 'fitness_one_sanitize_select', 'default' => esc_html(__('right','fitness-one')) )); $wp_customize->add_control('post_sidebar_position', array( 'label' => esc_html(__('Single Post Sidebar position', 'fitness-one')), 'section' => 'single_post_sidebar', 'settings' => 'post_sidebar_position', 'type' => 'radio', 'choices' => array( 'none' => esc_html(__('none','fitness-one')), 'left' => esc_html(__('left','fitness-one')), 'right' => esc_html(__('right','fitness-one')), ), )); /**********************************************/ /********** SINGLE PAGE SIDEBAR SECTION ***********/ /**********************************************/ $wp_customize->add_section('single_page_sidebar' , array( 'priority' => 30, 'title' => esc_html(__('Single Page Sidebar','fitness-one')), 'panel' => 'layout' )); $wp_customize->add_setting('page_sidebar_position', array( 'sanitize_callback' => 'fitness_one_sanitize_select', 'default' => esc_html(__('right','fitness-one')) )); $wp_customize->add_control('page_sidebar_position', array( 'label' => esc_html(__('Single Page Sidebar position', 'fitness-one')), 'section' => 'single_page_sidebar', 'settings' => 'page_sidebar_position', 'type' => 'radio', 'choices' => array( 'none' => esc_html(__('none','fitness-one')), 'left' => esc_html(__('left','fitness-one')), 'right' => esc_html(__('right','fitness-one')), ), )); $wp_customize->add_panel( 'meta_layout', array( 'priority' => 221, 'title' => esc_html(__( 'Fitness One Meta Layout', 'fitness-one')), 'description' => esc_html(__( 'Fitness One Meta Layout', 'fitness-one')), )); $wp_customize->add_section('fitness_one_post_meta' , array( 'priority' => 0, 'title' => esc_html(__('Post Meta','fitness-one')), 'panel' => 'meta_layout' )); $wp_customize->add_section('fitness_one_page_meta' , array( 'priority' => 0, 'title' => esc_html(__('Page Meta','fitness-one')), 'panel' => 'meta_layout' )); $wp_customize->add_section('fitness_one_blog_meta' , array( 'priority' => 0, 'title' => esc_html(__('Blog Meta','fitness-one')), 'panel' => 'meta_layout' )); } add_action( 'customize_register', 'fitness_one_customizer_register' ); /* * Kirki Fields */ function fitness_one_customizer_fields( $fields ) { // post meta $fields[] = array( 'type' => 'switch', 'settings' => 'fitness_one_posts_meta_show', 'label' => esc_html__( 'Show Meta?', 'fitness-one' ), 'description' => esc_html__( 'Choose whether to display date, category, author, tags for posts on the post page.', 'fitness-one' ), 'section' => 'fitness_one_post_meta', 'priority' => 1, 'default' => '1', 'choices' => array( 'on' => esc_attr__( 'SHOW', 'fitness-one' ), 'off' => esc_attr__( 'HIDE', 'fitness-one' ), ) ); $fields[] = array( 'type' => 'toggle', 'settings' => 'fitness_one_posts_date_show', 'label' => esc_html__( 'Show Date?', 'fitness-one' ), 'section' => 'fitness_one_post_meta', 'priority' => 2, 'default' => '1', 'active_callback' => array( array( 'setting' => 'fitness_one_posts_meta_show', 'operator' => '==', 'value' => '1', ), ) ); $fields[] = array( 'type' => 'toggle', 'settings' => 'fitness_one_posts_category_show', 'label' => esc_html__( 'Show Category?', 'fitness-one' ), 'section' => 'fitness_one_post_meta', 'priority' => 3, 'default' => '1', 'active_callback' => array( array( 'setting' => 'fitness_one_posts_meta_show', 'operator' => '==', 'value' => '1', ), ) ); $fields[] = array( 'type' => 'toggle', 'settings' => 'fitness_one_posts_author_show', 'label' => esc_html__( 'Show Author?', 'fitness-one' ), 'section' => 'fitness_one_post_meta', 'priority' => 4, 'default' => '1', 'active_callback' => array( array( 'setting' => 'fitness_one_posts_meta_show', 'operator' => '==', 'value' => '1', ), ) ); $fields[] = array( 'type' => 'toggle', 'settings' => 'fitness_one_posts_tags_show', 'label' => esc_html__( 'Show Tags?', 'fitness-one' ), 'section' => 'fitness_one_post_meta', 'priority' => 5, 'default' => '1', 'active_callback' => array( array( 'setting' => 'fitness_one_posts_meta_show', 'operator' => '==', 'value' => '1', ), ) ); $fields[] = array( 'type' => 'toggle', 'settings' => 'fitness_one_posts_comments_show', 'label' => esc_html__( 'Show Comment Count?', 'fitness-one' ), 'section' => 'fitness_one_post_meta', 'priority' => 5, 'default' => '1', 'active_callback' => array( array( 'setting' => 'fitness_one_posts_meta_show', 'operator' => '==', 'value' => '1', ), ) ); $fields[] = array( 'type' => 'toggle', 'settings' => 'fitness_one_post_breadcrumbs_show', 'label' => esc_html__( 'Show Breadcrumbs?', 'fitness-one' ), 'section' => 'fitness_one_post_meta', 'priority' => 6, 'default' => '1', 'active_callback' => array( array( 'setting' => 'fitness_one_posts_meta_show', 'operator' => '==', 'value' => '1', ), ) ); // page meta $fields[] = array( 'type' => 'switch', 'settings' => 'fitness_one_page_meta_show', 'label' => esc_html__( 'Show Meta?', 'fitness-one' ), 'description' => esc_html__( 'Choose whether to display date, category, author, tags for posts on the post page.', 'fitness-one' ), 'section' => 'fitness_one_page_meta', 'priority' => 1, 'default' => '1', 'choices' => array( 'on' => esc_attr__( 'SHOW', 'fitness-one' ), 'off' => esc_attr__( 'HIDE', 'fitness-one' ), ) ); $fields[] = array( 'type' => 'toggle', 'settings' => 'fitness_one_page_date_show', 'label' => esc_html__( 'Show Date?', 'fitness-one' ), 'section' => 'fitness_one_page_meta', 'priority' => 2, 'default' => '1', 'active_callback' => array( array( 'setting' => 'fitness_one_page_meta_show', 'operator' => '==', 'value' => '1', ), ) ); $fields[] = array( 'type' => 'toggle', 'settings' => 'fitness_one_page_author_show', 'label' => esc_html__( 'Show Author?', 'fitness-one' ), 'section' => 'fitness_one_page_meta', 'priority' => 4, 'default' => '1', 'active_callback' => array( array( 'setting' => 'fitness_one_page_meta_show', 'operator' => '==', 'value' => '1', ), ) ); $fields[] = array( 'type' => 'toggle', 'settings' => 'fitness_one_page_breadcrumbs_show', 'label' => esc_html__( 'Show Breadcrumbs?', 'fitness-one' ), 'section' => 'fitness_one_page_meta', 'priority' => 4, 'default' => '1', 'active_callback' => array( array( 'setting' => 'fitness_one_page_meta_show', 'operator' => '==', 'value' => '1', ), ) ); // blog meta $fields[] = array( 'type' => 'switch', 'settings' => 'fitness_one_blog_meta_show', 'label' => esc_html__( 'Show Meta?', 'fitness-one' ), 'description' => esc_html__( 'Choose whether to display date, category, author, tags for posts on the post page.', 'fitness-one' ), 'section' => 'fitness_one_blog_meta', 'priority' => 1, 'default' => '1', 'choices' => array( 'on' => esc_attr__( 'SHOW', 'fitness-one' ), 'off' => esc_attr__( 'HIDE', 'fitness-one' ), ) ); $fields[] = array( 'type' => 'toggle', 'settings' => 'fitness_one_blog_date_show', 'label' => esc_html__( 'Show Date?', 'fitness-one' ), 'section' => 'fitness_one_blog_meta', 'priority' => 2, 'default' => '1', 'active_callback' => array( array( 'setting' => 'fitness_one_blog_meta_show', 'operator' => '==', 'value' => '1', ), ) ); $fields[] = array( 'type' => 'toggle', 'settings' => 'fitness_one_blog_category_show', 'label' => esc_html__( 'Show Category?', 'fitness-one' ), 'section' => 'fitness_one_blog_meta', 'priority' => 3, 'default' => '1', 'active_callback' => array( array( 'setting' => 'fitness_one_blog_meta_show', 'operator' => '==', 'value' => '1', ), ) ); $fields[] = array( 'type' => 'toggle', 'settings' => 'fitness_one_blog_author_show', 'label' => esc_html__( 'Show Author?', 'fitness-one' ), 'section' => 'fitness_one_blog_meta', 'priority' => 4, 'default' => '1', 'active_callback' => array( array( 'setting' => 'fitness_one_blog_meta_show', 'operator' => '==', 'value' => '1', ), ) ); $fields[] = array( 'type' => 'toggle', 'settings' => 'fitness_one_blog_tags_show', 'label' => esc_html__( 'Show Tags?', 'fitness-one' ), 'section' => 'fitness_one_blog_meta', 'priority' => 5, 'default' => '1', 'active_callback' => array( array( 'setting' => 'fitness_one_blog_meta_show', 'operator' => '==', 'value' => '1', ), ) ); $fields[] = array( 'type' => 'toggle', 'settings' => 'fitness_one_blog_comments_show', 'label' => esc_html__( 'Show Comment Count?', 'fitness-one' ), 'section' => 'fitness_one_blog_meta', 'priority' => 5, 'default' => '1', 'active_callback' => array( array( 'setting' => 'fitness_one_blog_meta_show', 'operator' => '==', 'value' => '1', ), ) ); return $fields; } add_filter( 'kirki/fields', 'fitness_one_customizer_fields' ); ?>