register_control_type( 'Appliances_Store_Toggle_Control' ); //Register the sortable control type. $wp_customize->register_control_type( 'Appliances_Store_Control_Sortable' ); //add home page setting pannel $wp_customize->add_panel( 'appliances_store_panel_id', array( 'priority' => 10, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __( 'Custom Home page', 'appliances-store' ), 'description' => __( 'Description of what this panel does.', 'appliances-store' ), ) ); //TP GENRAL OPTION $wp_customize->add_section('appliances_store_tp_general_settings',array( 'title' => __('TP General Option', 'appliances-store'), 'priority' => 1, 'panel' => 'appliances_store_panel_id' ) ); $wp_customize->add_setting('appliances_store_tp_body_layout_settings',array( 'default' => 'Full', 'sanitize_callback' => 'appliances_store_sanitize_choices' )); $wp_customize->add_control('appliances_store_tp_body_layout_settings',array( 'type' => 'radio', 'label' => __('Body Layout Setting', 'appliances-store'), 'description' => __('This option work for complete body, if you want to set the complete website in container.', 'appliances-store'), 'section' => 'appliances_store_tp_general_settings', 'choices' => array( 'Full' => __('Full','appliances-store'), 'Container' => __('Container','appliances-store'), 'Container Fluid' => __('Container Fluid','appliances-store') ), ) ); // Add Settings and Controls for Post Layout $wp_customize->add_setting('appliances_store_sidebar_post_layout',array( 'default' => 'right', 'sanitize_callback' => 'appliances_store_sanitize_choices' )); $wp_customize->add_control('appliances_store_sidebar_post_layout',array( 'type' => 'radio', 'label' => __('Post Sidebar Position', 'appliances-store'), 'description' => __('This option work for blog page, blog single page, archive page and search page.', 'appliances-store'), 'section' => 'appliances_store_tp_general_settings', 'choices' => array( 'full' => __('Full','appliances-store'), 'left' => __('Left','appliances-store'), 'right' => __('Right','appliances-store'), 'three-column' => __('Three Columns','appliances-store'), 'four-column' => __('Four Columns','appliances-store'), 'grid' => __('Grid Layout','appliances-store') ), ) ); // Add Settings and Controls for post sidebar Layout $wp_customize->add_setting('appliances_store_sidebar_single_post_layout',array( 'default' => 'right', 'sanitize_callback' => 'appliances_store_sanitize_choices' )); $wp_customize->add_control('appliances_store_sidebar_single_post_layout',array( 'type' => 'radio', 'label' => __('Single Post Sidebar Position', 'appliances-store'), 'description' => __('This option work for single blog page', 'appliances-store'), 'section' => 'appliances_store_tp_general_settings', 'choices' => array( 'full' => __('Full','appliances-store'), 'left' => __('Left','appliances-store'), 'right' => __('Right','appliances-store'), ), ) ); // Add Settings and Controls for Page Layout $wp_customize->add_setting('appliances_store_sidebar_page_layout',array( 'default' => 'right', 'sanitize_callback' => 'appliances_store_sanitize_choices' )); $wp_customize->add_control('appliances_store_sidebar_page_layout',array( 'type' => 'radio', 'label' => __('Page Sidebar Position', 'appliances-store'), 'description' => __('This option work for pages.', 'appliances-store'), 'section' => 'appliances_store_tp_general_settings', 'choices' => array( 'full' => __('Full','appliances-store'), 'left' => __('Left','appliances-store'), 'right' => __('Right','appliances-store') ), ) ); $wp_customize->add_setting( 'appliances_store_sticky', array( 'default' => false, 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_checkbox', ) ); $wp_customize->add_control( new Appliances_Store_Toggle_Control( $wp_customize, 'appliances_store_sticky', array( 'label' => esc_html__( 'Show Sticky Header', 'appliances-store' ), 'section' => 'appliances_store_tp_general_settings', 'type' => 'toggle', 'settings' => 'appliances_store_sticky', ) ) ); //tp typography option $appliances_store_font_array = array( '' => 'No Fonts', 'Abril Fatface' => 'Abril Fatface', 'Acme' => 'Acme', 'Anton' => 'Anton', 'Architects Daughter' => 'Architects Daughter', 'Arimo' => 'Arimo', 'Arsenal' => 'Arsenal', 'Arvo' => 'Arvo', 'Alegreya' => 'Alegreya', 'Alfa Slab One' => 'Alfa Slab One', 'Averia Serif Libre' => 'Averia Serif Libre', 'Bangers' => 'Bangers', 'Boogaloo' => 'Boogaloo', 'Bad Script' => 'Bad Script', 'Bitter' => 'Bitter', 'Bree Serif' => 'Bree Serif', 'BenchNine' => 'BenchNine', 'Cabin' => 'Cabin', 'Cardo' => 'Cardo', 'Courgette' => 'Courgette', 'Cherry Swash' => 'Cherry Swash', 'Cormorant Garamond' => 'Cormorant Garamond', 'Crimson Text' => 'Crimson Text', 'Cuprum' => 'Cuprum', 'Cookie' => 'Cookie', 'Chewy' => 'Chewy', 'Days One' => 'Days One', 'Dosis' => 'Dosis', 'Droid Sans' => 'Droid Sans', 'Economica' => 'Economica', 'Fredoka One' => 'Fredoka One', 'Fjalla One' => 'Fjalla One', 'Francois One' => 'Francois One', 'Frank Ruhl Libre' => 'Frank Ruhl Libre', 'Gloria Hallelujah' => 'Gloria Hallelujah', 'Great Vibes' => 'Great Vibes', 'Handlee' => 'Handlee', 'Hammersmith One' => 'Hammersmith One', 'Inconsolata' => 'Inconsolata', 'Indie Flower' => 'Indie Flower', 'Inter' => 'Inter', 'IM Fell English SC' => 'IM Fell English SC', 'Julius Sans One' => 'Julius Sans One', 'Josefin Slab' => 'Josefin Slab', 'Josefin Sans' => 'Josefin Sans', 'Kanit' => 'Kanit', 'Lobster' => 'Lobster', 'Lato' => 'Lato', 'Lora' => 'Lora', 'Libre Baskerville' => 'Libre Baskerville', 'Lobster Two' => 'Lobster Two', 'Merriweather' => 'Merriweather', 'Monda' => 'Monda', 'Montserrat' => 'Montserrat', 'Muli' => 'Muli', 'Marck Script' => 'Marck Script', 'Noto Serif' => 'Noto Serif', 'Open Sans' => 'Open Sans', 'Overpass' => 'Overpass', 'Overpass Mono' => 'Overpass Mono', 'Oxygen' => 'Oxygen', 'Orbitron' => 'Orbitron', 'Patua One' => 'Patua One', 'Pacifico' => 'Pacifico', 'Padauk' => 'Padauk', 'Playball' => 'Playball', 'Playfair Display' => 'Playfair Display', 'PT Sans' => 'PT Sans', 'Philosopher' => 'Philosopher', 'Permanent Marker' => 'Permanent Marker', 'Poiret One' => 'Poiret One', 'Quicksand' => 'Quicksand', 'Quattrocento Sans' => 'Quattrocento Sans', 'Raleway' => 'Raleway', 'Rubik' => 'Rubik', 'Rokkitt' => 'Rokkitt', 'Russo One' => 'Russo One', 'Righteous' => 'Righteous', 'Slabo' => 'Slabo', 'Source Sans Pro' => 'Source Sans Pro', 'Shadows Into Light Two' => 'Shadows Into Light Two', 'Shadows Into Light' => 'Shadows Into Light', 'Sacramento' => 'Sacramento', 'Shrikhand' => 'Shrikhand', 'Tangerine' => 'Tangerine', 'Ubuntu' => 'Ubuntu', 'VT323' => 'VT323', 'Varela Round' => 'Varela Round', 'Vampiro One' => 'Vampiro One', 'Vollkorn' => 'Vollkorn', 'Volkhov' => 'Volkhov', 'Yanone Kaffeesatz' => 'Yanone Kaffeesatz' ); $wp_customize->add_section('appliances_store_typography_option',array( 'title' => __('TP Typography Option', 'appliances-store'), 'priority' => 1, 'panel' => 'appliances_store_panel_id' )); $wp_customize->add_setting('appliances_store_heading_font_family', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'appliances_store_sanitize_choices', )); $wp_customize->add_control( 'appliances_store_heading_font_family', array( 'section' => 'appliances_store_typography_option', 'label' => __('heading Fonts', 'appliances-store'), 'type' => 'select', 'choices' => $appliances_store_font_array, )); $wp_customize->add_setting('appliances_store_body_font_family', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'appliances_store_sanitize_choices', )); $wp_customize->add_control( 'appliances_store_body_font_family', array( 'section' => 'appliances_store_typography_option', 'label' => __('Body Fonts', 'appliances-store'), 'type' => 'select', 'choices' => $appliances_store_font_array, )); //TP Preloader Option $wp_customize->add_section('appliances_store_prelaoder_option',array( 'title' => __('TP Preloader Option', 'appliances-store'), 'priority' => 1, 'panel' => 'appliances_store_panel_id' ) ); $wp_customize->add_setting( 'appliances_store_preloader_show_hide', array( 'default' => false, 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_checkbox', ) ); $wp_customize->add_control( new Appliances_Store_Toggle_Control( $wp_customize, 'appliances_store_preloader_show_hide', array( 'label' => esc_html__( 'Show / Hide Preloader Option', 'appliances-store' ), 'section' => 'appliances_store_prelaoder_option', 'type' => 'toggle', 'settings' => 'appliances_store_preloader_show_hide', ) ) ); $wp_customize->add_setting( 'appliances_store_tp_preloader_color1_option', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'appliances_store_tp_preloader_color1_option', array( 'label' => __('Preloader First Ring Color', 'appliances-store'), 'description' => __('It will change the complete theme preloader ring 1 color in one click.', 'appliances-store'), 'section' => 'appliances_store_prelaoder_option', 'settings' => 'appliances_store_tp_preloader_color1_option', ))); $wp_customize->add_setting( 'appliances_store_tp_preloader_color2_option', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'appliances_store_tp_preloader_color2_option', array( 'label' => __('Preloader Second Ring Color', 'appliances-store'), 'description' => __('It will change the complete theme preloader ring 2 color in one click.', 'appliances-store'), 'section' => 'appliances_store_prelaoder_option', 'settings' => 'appliances_store_tp_preloader_color2_option', ))); $wp_customize->add_setting( 'appliances_store_tp_preloader_bg_color_option', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'appliances_store_tp_preloader_bg_color_option', array( 'label' => __('Preloader Background Color', 'appliances-store'), 'description' => __('It will change the complete theme preloader bg color in one click.', 'appliances-store'), 'section' => 'appliances_store_prelaoder_option', 'settings' => 'appliances_store_tp_preloader_bg_color_option', ))); //TP Color Option $wp_customize->add_section('appliances_store_color_option',array( 'title' => __('TP Color Option', 'appliances-store'), 'priority' => 1, 'panel' => 'appliances_store_panel_id' ) ); $wp_customize->add_setting( 'appliances_store_tp_color_option_first', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'appliances_store_tp_color_option_first', array( 'label' => __('Theme First Color', 'appliances-store'), 'description' => __('It will change the complete theme color in one click.', 'appliances-store'), 'section' => 'appliances_store_color_option', 'settings' => 'appliances_store_tp_color_option_first', ))); $wp_customize->add_setting( 'appliances_store_tp_color_option_second', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'appliances_store_tp_color_option_second', array( 'label' => __('Theme Second Color', 'appliances-store'), 'description' => __('It will change the complete theme color in one click.', 'appliances-store'), 'section' => 'appliances_store_color_option', 'settings' => 'appliances_store_tp_color_option_second', ))); //TP Blog Option $wp_customize->add_section('appliances_store_blog_option',array( 'title' => __('TP Blog Option', 'appliances-store'), 'priority' => 1, 'panel' => 'appliances_store_panel_id' ) ); /** Meta Order */ $wp_customize->add_setting('blog_meta_order', array( 'default' => array('date', 'author', 'comment','category'), 'sanitize_callback' => 'appliances_store_sanitize_sortable', )); $wp_customize->add_control(new Appliances_Store_Control_Sortable($wp_customize, 'blog_meta_order', array( 'label' => esc_html__('Meta Order', 'appliances-store'), 'description' => __('Drag & Drop post items to re-arrange the order and also hide and show items as per the need by clicking on the eye icon.', 'appliances-store') , 'section' => 'appliances_store_blog_option', 'choices' => array( 'date' => __('date', 'appliances-store') , 'author' => __('author', 'appliances-store') , 'comment' => __('comment', 'appliances-store') , 'category' => __('category', 'appliances-store') , ) , ))); $wp_customize->add_setting( 'appliances_store_excerpt_count', array( 'default' => 35, 'type' => 'theme_mod', 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_number_range', 'sanitize_js_callback' => 'absint', ) ); $wp_customize->add_control( 'appliances_store_excerpt_count', array( 'label' => esc_html__( 'Edit Excerpt Limit','appliances-store' ), 'section' => 'appliances_store_blog_option', 'type' => 'number', 'input_attrs' => array( 'step' => 2, 'min' => 0, 'max' => 50, ), ) ); $wp_customize->add_setting('appliances_store_read_more_text',array( 'default'=> __('Read More','appliances-store'), 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('appliances_store_read_more_text',array( 'label' => __('Edit Button Text','appliances-store'), 'section'=> 'appliances_store_blog_option', 'type'=> 'text' )); $wp_customize->add_setting('appliances_store_post_image_round', array( 'default' => '0', 'sanitize_callback' => 'appliances_store_sanitize_number_range', )); $wp_customize->add_control(new Appliances_Store_Range_Slider($wp_customize, 'appliances_store_post_image_round', array( 'section' => 'appliances_store_blog_option', 'label' => esc_html__('Edit Post Image Border Radius', 'appliances-store'), 'input_attrs' => array( 'min' => 0, 'max' => 180, 'step' => 1 ) ))); $wp_customize->add_setting('appliances_store_post_image_width', array( 'default' => '', 'sanitize_callback' => 'appliances_store_sanitize_number_range', )); $wp_customize->add_control(new Appliances_Store_Range_Slider($wp_customize, 'appliances_store_post_image_width', array( 'section' => 'appliances_store_blog_option', 'label' => esc_html__('Edit Post Image Width', 'appliances-store'), 'input_attrs' => array( 'min' => 0, 'max' => 367, 'step' => 1 ) ))); $wp_customize->add_setting('appliances_store_post_image_length', array( 'default' => '', 'sanitize_callback' => 'appliances_store_sanitize_number_range', )); $wp_customize->add_control(new Appliances_Store_Range_Slider($wp_customize, 'appliances_store_post_image_length', array( 'section' => 'appliances_store_blog_option', 'label' => esc_html__('Edit Post Image height', 'appliances-store'), 'input_attrs' => array( 'min' => 0, 'max' => 900, 'step' => 1 ) ))); $wp_customize->add_setting( 'appliances_store_remove_read_button', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_checkbox', ) ); $wp_customize->add_control( new Appliances_Store_Toggle_Control( $wp_customize, 'appliances_store_remove_read_button', array( 'label' => esc_html__( 'Show / Hide Read More Button', 'appliances-store' ), 'section' => 'appliances_store_blog_option', 'type' => 'toggle', 'settings' => 'appliances_store_remove_read_button', ) ) ); $wp_customize->add_setting( 'appliances_store_remove_tags', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_checkbox', ) ); $wp_customize->add_control( new Appliances_Store_Toggle_Control( $wp_customize, 'appliances_store_remove_tags', array( 'label' => esc_html__( 'Show / Hide Tags Option', 'appliances-store' ), 'section' => 'appliances_store_blog_option', 'type' => 'toggle', 'settings' => 'appliances_store_remove_tags', ) ) ); $wp_customize->add_setting( 'appliances_store_remove_category', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_checkbox', ) ); $wp_customize->add_control( new Appliances_Store_Toggle_Control( $wp_customize, 'appliances_store_remove_category', array( 'label' => esc_html__( 'Show / Hide Category Option', 'appliances-store' ), 'section' => 'appliances_store_blog_option', 'type' => 'toggle', 'settings' => 'appliances_store_remove_category', ) ) ); $wp_customize->add_setting( 'appliances_store_remove_comment', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_checkbox', ) ); $wp_customize->add_control( new Appliances_Store_Toggle_Control( $wp_customize, 'appliances_store_remove_comment', array( 'label' => esc_html__( 'Show / Hide Comment Form', 'appliances-store' ), 'section' => 'appliances_store_blog_option', 'type' => 'toggle', 'settings' => 'appliances_store_remove_comment', ) ) ); $wp_customize->add_setting( 'appliances_store_remove_related_post', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_checkbox', ) ); $wp_customize->add_control( new Appliances_Store_Toggle_Control( $wp_customize, 'appliances_store_remove_related_post', array( 'label' => esc_html__( 'Show / Hide Related Post', 'appliances-store' ), 'section' => 'appliances_store_blog_option', 'type' => 'toggle', 'settings' => 'appliances_store_remove_related_post', ) ) ); $wp_customize->add_setting('appliances_store_related_post_heading',array( 'default'=> __('Related Posts','appliances-store'), 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('appliances_store_related_post_heading',array( 'label' => __('Edit Section Title','appliances-store'), 'section'=> 'appliances_store_blog_option', 'type'=> 'text' )); $wp_customize->add_setting( 'appliances_store_related_post_per_page', array( 'default' => 3, 'type' => 'theme_mod', 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_number_range', 'sanitize_js_callback' => 'absint', ) ); $wp_customize->add_control( 'appliances_store_related_post_per_page', array( 'label' => esc_html__( 'Related Post Per Page','appliances-store' ), 'section' => 'appliances_store_blog_option', 'type' => 'number', 'input_attrs' => array( 'step' => 1, 'min' => 3, 'max' => 9, ), ) ); $wp_customize->add_setting( 'appliances_store_related_post_per_columns', array( 'default' => 3, 'type' => 'theme_mod', 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_number_range', 'sanitize_js_callback' => 'absint', ) ); $wp_customize->add_control( 'appliances_store_related_post_per_columns', array( 'label' => esc_html__( 'Related Post Per Row','appliances-store' ), 'section' => 'appliances_store_blog_option', 'type' => 'number', 'input_attrs' => array( 'step' => 1, 'min' => 1, 'max' => 4, ), ) ); $wp_customize->add_setting('appliances_store_post_layout',array( 'default' => 'image-content', 'sanitize_callback' => 'appliances_store_sanitize_choices' )); $wp_customize->add_control('appliances_store_post_layout',array( 'type' => 'radio', 'label' => __('Post Layout', 'appliances-store'), 'section' => 'appliances_store_blog_option', 'choices' => array( 'image-content' => __('Media-Content','appliances-store'), 'content-image' => __('Content-Media','appliances-store'), ), ) ); //MENU TYPOGRAPHY $wp_customize->add_section( 'appliances_store_menu_typography', array( 'title' => __( 'Menu Typography', 'appliances-store' ), 'priority' => 2, 'panel' => 'appliances_store_panel_id' ) ); $wp_customize->add_setting('appliances_store_menu_font_family', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'appliances_store_sanitize_choices', )); $wp_customize->add_control( 'appliances_store_menu_font_family', array( 'section' => 'appliances_store_menu_typography', 'label' => __('Menu Fonts', 'appliances-store'), 'type' => 'select', 'choices' => $appliances_store_font_array, )); $wp_customize->add_setting('appliances_store_menu_font_weight',array( 'default' => '', 'sanitize_callback' => 'appliances_store_sanitize_choices' )); $wp_customize->add_control('appliances_store_menu_font_weight',array( 'type' => 'radio', 'label' => __('Font Weight', 'appliances-store'), 'section' => 'appliances_store_menu_typography', 'type' => 'select', 'choices' => array( '100' => __('100','appliances-store'), '200' => __('200','appliances-store'), '300' => __('300','appliances-store'), '400' => __('400','appliances-store'), '500' => __('500','appliances-store'), '600' => __('600','appliances-store'), '700' => __('700','appliances-store'), '800' => __('800','appliances-store'), '900' => __('900','appliances-store') ), ) ); $wp_customize->add_setting('appliances_store_menu_text_tranform',array( 'default' => '', 'sanitize_callback' => 'appliances_store_sanitize_choices' )); $wp_customize->add_control('appliances_store_menu_text_tranform',array( 'type' => 'select', 'label' => __('Menu Text Transform','appliances-store'), 'section' => 'appliances_store_menu_typography', 'choices' => array( 'Uppercase' => __('Uppercase','appliances-store'), 'Lowercase' => __('Lowercase','appliances-store'), 'Capitalize' => __('Capitalize','appliances-store'), ), ) ); $wp_customize->add_setting('appliances_store_menu_font_size', array( 'default' => '', 'sanitize_callback' => 'appliances_store_sanitize_number_range', )); $wp_customize->add_control(new Appliances_Store_Range_Slider($wp_customize, 'appliances_store_menu_font_size', array( 'section' => 'appliances_store_menu_typography', 'label' => esc_html__('Font Size', 'appliances-store'), 'input_attrs' => array( 'min' => 0, 'max' => 20, 'step' => 1 ) ))); // Top Bar $wp_customize->add_section( 'appliances_store_topbar', array( 'title' => __( 'Header Details', 'appliances-store' ), 'priority' => 2, 'description' => __( 'Add your contact details', 'appliances-store' ), 'panel' => 'appliances_store_panel_id' ) ); $wp_customize->add_setting( 'appliances_store_currency_switcher', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_checkbox', ) ); $wp_customize->add_control( new Appliances_Store_Toggle_Control( $wp_customize, 'appliances_store_currency_switcher', array( 'label' => esc_html__( 'Show / Hide Currency Switcher', 'appliances-store' ), 'section' => 'appliances_store_topbar', 'type' => 'toggle', 'settings' => 'appliances_store_currency_switcher', ) ) ); $wp_customize->add_setting( 'appliances_store_cart_language_translator', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_checkbox', ) ); $wp_customize->add_control( new Appliances_Store_Toggle_Control( $wp_customize, 'appliances_store_cart_language_translator', array( 'label' => esc_html__( 'Show / Hide Language Translator', 'appliances-store' ), 'section' => 'appliances_store_topbar', 'type' => 'toggle', 'settings' => 'appliances_store_cart_language_translator', ) ) ); $wp_customize->add_setting('appliances_store_track_order_button_sec',array( 'default'=> 'Tracking Order', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('appliances_store_track_order_button_sec',array( 'label' => __('Change Tracking Order Text','appliances-store'), 'section'=> 'appliances_store_topbar', 'type'=> 'text' )); $wp_customize->add_setting('appliances_store_track_order_link_sec',array( 'default'=> '', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('appliances_store_track_order_link_sec',array( 'label' => __('Add Tracking Order Link','appliances-store'), 'section'=> 'appliances_store_topbar', 'type'=> 'url' )); $wp_customize->add_setting( 'appliances_store_header_call_text',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control( 'appliances_store_header_call_text',array( 'label' => __('Add Phone Text','appliances-store'), 'section'=> 'appliances_store_topbar', 'type'=> 'text' )); $wp_customize->add_setting( 'appliances_store_header_call_no', array( 'default'=> '', 'sanitize_callback' => 'appliances_store_sanitize_phone_number' )); $wp_customize->add_control( 'appliances_store_header_call_no',array( 'label' => __('Add Phone Number','appliances-store'), 'section'=> 'appliances_store_topbar', 'type'=> 'text' )); //home page slider $wp_customize->add_section( 'appliances_store_slider_section' , array( 'title' => __( 'Banner Section', 'appliances-store' ), 'priority' => 2, 'panel' => 'appliances_store_panel_id' ) ); $wp_customize->add_setting( 'appliances_store_slider_arrows', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_checkbox', ) ); $wp_customize->add_control( new Appliances_Store_Toggle_Control( $wp_customize, 'appliances_store_slider_arrows', array( 'label' => esc_html__( 'Show / Hide Banner', 'appliances-store' ), 'section' => 'appliances_store_slider_section', 'type' => 'toggle', 'settings' => 'appliances_store_slider_arrows', ) ) ); $wp_customize->add_setting( 'appliances_store_slider_page', array( 'default' => '', 'sanitize_callback' => 'appliances_store_sanitize_dropdown_pages' ) ); $wp_customize->add_control( 'appliances_store_slider_page', array( 'label' => __( 'Select Banner Page', 'appliances-store' ), 'section' => 'appliances_store_slider_section', 'type' => 'dropdown-pages' ) ); $wp_customize->add_setting('appliances_store_slider_short_heading',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('appliances_store_slider_short_heading',array( 'label' => __('Add Banner short Heading','appliances-store'), 'section'=> 'appliances_store_slider_section', 'type'=> 'text' )); $wp_customize->add_setting('appliances_store_product_clock_timer_end',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('appliances_store_product_clock_timer_end',array( 'label' => __('Countdown Timer End Date','appliances-store'), 'section' => 'appliances_store_slider_section', 'description' => __('Set the end date and time for the countdown timer. Use the following format: "Month Day, Year Hour:Minute:Second" (e.g., "March 30, 2025 11:00:00"). The timer will automatically calculate the remaining time based on the current date and time.','appliances-store'), 'type'=> 'text' )); // banner1 $wp_customize->add_setting('appliances_store_discount_sale_img1',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'appliances_store_discount_sale_img1',array( 'label' => __('Select Right Banner Image','appliances-store'), 'section' => 'appliances_store_slider_section' ))); $wp_customize->add_setting('appliances_store_product_sale_discount_title1',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('appliances_store_product_sale_discount_title1',array( 'label' => __('Add Products Title for Right Banner','appliances-store'), 'section'=> 'appliances_store_slider_section', 'type'=> 'text' )); $wp_customize->add_setting('appliances_store_product_btn_text1',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('appliances_store_product_btn_text1',array( 'label' => esc_html__('Add Product Button Text for Right Banner','appliances-store'), 'section'=> 'appliances_store_slider_section', 'type'=> 'text' )); $wp_customize->add_setting('appliances_store_product_btn_link1',array( 'default'=> '', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('appliances_store_product_btn_link1',array( 'label' => esc_html__('Add Product Button link for Right Banner','appliances-store'), 'section'=> 'appliances_store_slider_section', 'type'=> 'url' )); $wp_customize->add_setting('appliances_store_product_sale_discount',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('appliances_store_product_sale_discount',array( 'label' => __('Add Product Discount Value for Right Banner (ex: 15%)','appliances-store'), 'section'=> 'appliances_store_slider_section', 'type'=> 'text' )); // Banner Section $wp_customize->add_section('appliances_store_banner_main_sec', array( 'title' => __('Our Product Sale Section', 'appliances-store'), 'panel' => 'appliances_store_panel_id', 'priority' => 3, )); // banner1 $wp_customize->add_setting('appliances_store_product_banner_one',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'appliances_store_product_banner_one',array( 'label' => __('Select Product Banner Image 1','appliances-store'), 'section' => 'appliances_store_banner_main_sec' ))); $wp_customize->add_setting('appliances_store_product_banner_one_title1',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('appliances_store_product_banner_one_title1',array( 'label' => __('Add Product Banner Title 1','appliances-store'), 'section'=> 'appliances_store_banner_main_sec', 'type'=> 'text' )); $wp_customize->add_setting('appliances_store_product_banner_one_btn_text1',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('appliances_store_product_banner_one_btn_text1',array( 'label' => esc_html__('Add Product Button Text for Banner 1','appliances-store'), 'section'=> 'appliances_store_banner_main_sec', 'type'=> 'text' )); $wp_customize->add_setting('appliances_store_product_banner_one_btn_link1',array( 'default'=> '', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('appliances_store_product_banner_one_btn_link1',array( 'label' => esc_html__('Add Product Button link for Banner 1','appliances-store'), 'section'=> 'appliances_store_banner_main_sec', 'type'=> 'url' )); // banner2 $wp_customize->add_setting('appliances_store_product_banner_two',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'appliances_store_product_banner_two',array( 'label' => __('Select Product Banner Image 2','appliances-store'), 'section' => 'appliances_store_banner_main_sec' ))); $wp_customize->add_setting('appliances_store_product_banner_two_title1',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('appliances_store_product_banner_two_title1',array( 'label' => __('Add Product Banner Title 2','appliances-store'), 'section'=> 'appliances_store_banner_main_sec', 'type'=> 'text' )); $wp_customize->add_setting('appliances_store_banner_sec_discount',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('appliances_store_banner_sec_discount',array( 'label' => __('Add Product Discount Value for Banner 2 (ex: 15%)','appliances-store'), 'section'=> 'appliances_store_banner_main_sec', 'type'=> 'text' )); // banner3 $wp_customize->add_setting('appliances_store_product_banner_three',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'appliances_store_product_banner_three',array( 'label' => __('Select Product Banner Image 3','appliances-store'), 'section' => 'appliances_store_banner_main_sec' ))); $wp_customize->add_setting('appliances_store_product_banner_three_title1',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('appliances_store_product_banner_three_title1',array( 'label' => __('Add Product Banner Title 3','appliances-store'), 'section'=> 'appliances_store_banner_main_sec', 'type'=> 'text' )); $wp_customize->add_setting('appliances_store_product_banner_three_btn_text1',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('appliances_store_product_banner_three_btn_text1',array( 'label' => esc_html__('Add Product Button Text for Banner 3','appliances-store'), 'section'=> 'appliances_store_banner_main_sec', 'type'=> 'text' )); $wp_customize->add_setting('appliances_store_product_banner_three_btn_link1',array( 'default'=> '', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('appliances_store_product_banner_three_btn_link1',array( 'label' => esc_html__('Add Product Button link for Banner 3','appliances-store'), 'section'=> 'appliances_store_banner_main_sec', 'type'=> 'url' )); // Product Category Section $wp_customize->add_section('appliances_store_product_cat_section', array( 'title' => __('Product Category Section', 'appliances-store'), 'panel' => 'appliances_store_panel_id', 'priority' => 4, )); $wp_customize->add_setting( 'appliances_store_project_show_hide', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_checkbox', )); $wp_customize->add_control( new Appliances_Store_Toggle_Control( $wp_customize, 'appliances_store_project_show_hide', array( 'label' => esc_html__( 'Show / Hide Product Category', 'appliances-store' ), 'section' => 'appliances_store_product_cat_section', 'type' => 'toggle', 'settings' => 'appliances_store_project_show_hide', )) ); $appliances_store_shop_args = array( 'post_type' => 'product', 'posts_per_page' => -1, 'order' => 'ASC', 'orderby' => 'title', ); $appliances_store_shop_products = get_posts($appliances_store_shop_args); $appliances_store_shop_product_posts = array(); $appliances_store_shop_product_posts[''] = 'Select'; foreach ($appliances_store_shop_products as $appliances_store_shop_product) { $appliances_store_shop_product_posts[$appliances_store_shop_product->ID] = $appliances_store_shop_product->post_title; } $wp_customize->add_setting('appliances_store_shop_slider_product', array( 'default' => '', 'sanitize_callback' => 'appliances_store_sanitize_choices', )); $wp_customize->add_control('appliances_store_shop_slider_product', array( 'type' => 'select', 'choices' => $appliances_store_shop_product_posts, 'label' => __('Select Product', 'appliances-store'), 'section' => 'appliances_store_product_cat_section', )); $wp_customize->add_setting('appliances_store_projetcs_main_heading',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('appliances_store_projetcs_main_heading',array( 'label' => esc_html__('Section Heading','appliances-store'), 'section'=> 'appliances_store_product_cat_section', 'type'=> 'text' )); // Customizer: Add setting for the number of tabs $wp_customize->add_setting('appliances_store_projetcs_number', array( 'default' => '6', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('appliances_store_projetcs_number', array( 'label' => esc_html__('Number of Tabs to show', 'appliances-store'), 'section' => 'appliances_store_product_cat_section', 'type' => 'number', 'input_attrs' => array( 'step' => 1, 'min' => 1, 'max' => 50, ), )); // Loop to add controls for each tab $appliances_store_featured_post = get_theme_mod('appliances_store_projetcs_number', 6); for ($appliances_store_j = 1; $appliances_store_j <= $appliances_store_featured_post; $appliances_store_j++) { // Icon setting for each tab $wp_customize->add_setting('appliances_store_services_icon' . $appliances_store_j, array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control(new Appliances_Store_Icon_Changer( $wp_customize, 'appliances_store_services_icon' . $appliances_store_j, array( 'label' => __('Change Service Icon ', 'appliances-store') . $appliances_store_j, 'transport' => 'refresh', 'section' => 'appliances_store_product_cat_section', 'type' => 'icon' ) )); // Text for each tab $wp_customize->add_setting('appliances_store_projetcs_text' . $appliances_store_j, array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('appliances_store_projetcs_text' . $appliances_store_j, array( 'label' => esc_html__('Product Category Name ', 'appliances-store') . $appliances_store_j, 'section' => 'appliances_store_product_cat_section', 'type' => 'text' )); // Category select for each tab $product_categories = get_terms(array( 'taxonomy' => 'product_cat', 'hide_empty' => false, )); $product_cat_options = array(); $product_cat_options[''] = 'Select'; foreach ($product_categories as $product_category) { if (isset($product_category->slug, $product_category->name)) { $product_cat_options[$product_category->slug] = $product_category->name; } } $wp_customize->add_setting('appliances_store_projetcs_category' . $appliances_store_j, array( 'default' => '', 'sanitize_callback' => 'appliances_store_sanitize_choices', )); $wp_customize->add_control('appliances_store_projetcs_category' . $appliances_store_j, array( 'type' => 'select', 'choices' => $product_cat_options, 'label' => __('Select Product Category to display products ', 'appliances-store') . $appliances_store_j, 'section' => 'appliances_store_product_cat_section', )); } //footer $wp_customize->add_section('appliances_store_footer_section',array( 'title' => __('Footer Text','appliances-store'), 'description' => __('Add copyright text.','appliances-store'), 'panel' => 'appliances_store_panel_id', 'priority' => 4, )); $wp_customize->add_setting('appliances_store_footer_text',array( 'default' => 'Appliances Store WordPress Theme', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('appliances_store_footer_text',array( 'label' => __('Copyright Text','appliances-store'), 'section' => 'appliances_store_footer_section', 'type' => 'text' )); //footer widget title font size $wp_customize->add_setting('appliances_store_footer_copyright_font_size',array( 'default' => '', 'sanitize_callback' => 'appliances_store_sanitize_number_absint' )); $wp_customize->add_control('appliances_store_footer_copyright_font_size',array( 'label' => __('Change Footer Copyright Font Size in PX','appliances-store'), 'section' => 'appliances_store_footer_section', 'setting' => 'appliances_store_footer_copyright_font_size', 'type' => 'number', 'input_attrs' => array( 'step' => 1, 'min' => 0, 'max' => 50, ), )); $wp_customize->add_setting( 'appliances_store_footer_copyright_text_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'appliances_store_footer_copyright_text_color', array( 'label' => __('Change Footer Copyright Text Color', 'appliances-store'), 'section' => 'appliances_store_footer_section', 'settings' => 'appliances_store_footer_copyright_text_color', ))); $wp_customize->add_setting('appliances_store_footer_copyright_top_bottom_padding',array( 'default' => '', 'sanitize_callback' => 'appliances_store_sanitize_number_absint' )); $wp_customize->add_control('appliances_store_footer_copyright_top_bottom_padding',array( 'label' => __('Change Footer Copyright Padding in PX','appliances-store'), 'section' => 'appliances_store_footer_section', 'setting' => 'appliances_store_footer_copyright_top_bottom_padding', 'type' => 'number', 'input_attrs' => array( 'step' => 1, 'min' => 0, 'max' => 50, ), )); // Add Settings and Controls for Scroll top $wp_customize->add_setting('appliances_store_copyright_text_position',array( 'default' => 'Center', 'sanitize_callback' => 'appliances_store_sanitize_choices' )); $wp_customize->add_control('appliances_store_copyright_text_position',array( 'type' => 'radio', 'label' => __('Copyright Text Position', 'appliances-store'), 'description' => __('This option work for Copyright', 'appliances-store'), 'section' => 'appliances_store_footer_section', 'choices' => array( 'Right' => __('Right','appliances-store'), 'Left' => __('Left','appliances-store'), 'Center' => __('Center','appliances-store') ), ) ); // footer columns $wp_customize->add_setting('appliances_store_footer_columns',array( 'default' => 4, 'sanitize_callback' => 'appliances_store_sanitize_number_absint' )); $wp_customize->add_control('appliances_store_footer_columns',array( 'label' => __('Footer Widget Columns','appliances-store'), 'section' => 'appliances_store_footer_section', 'setting' => 'appliances_store_footer_columns', 'type' => 'number', 'input_attrs' => array( 'step' => 1, 'min' => 1, 'max' => 4, ), )); $wp_customize->add_setting( 'appliances_store_tp_footer_bg_color_option', array( 'default' => '#151515', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'appliances_store_tp_footer_bg_color_option', array( 'label' => __('Footer Widget Background Color', 'appliances-store'), 'description' => __('It will change the complete footer widget backgorund color.', 'appliances-store'), 'section' => 'appliances_store_footer_section', 'settings' => 'appliances_store_tp_footer_bg_color_option', ))); $wp_customize->add_setting('appliances_store_footer_widget_image',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'appliances_store_footer_widget_image',array( 'label' => __('Footer Widget Background Image','appliances-store'), 'section' => 'appliances_store_footer_section' ))); //footer widget title font size $wp_customize->add_setting('appliances_store_footer_widget_title_font_size',array( 'default' => '', 'sanitize_callback' => 'appliances_store_sanitize_number_absint' )); $wp_customize->add_control('appliances_store_footer_widget_title_font_size',array( 'label' => __('Change Footer Widget Title Font Size in PX','appliances-store'), 'section' => 'appliances_store_footer_section', 'setting' => 'appliances_store_footer_widget_title_font_size', 'type' => 'number', 'input_attrs' => array( 'step' => 1, 'min' => 0, 'max' => 50, ), )); $wp_customize->add_setting( 'appliances_store_footer_widget_title_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'appliances_store_footer_widget_title_color', array( 'label' => __('Change Footer Widget Title Color', 'appliances-store'), 'section' => 'appliances_store_footer_section', 'settings' => 'appliances_store_footer_widget_title_color', ))); $wp_customize->add_setting( 'appliances_store_return_to_header', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_checkbox', ) ); $wp_customize->add_control( new Appliances_Store_Toggle_Control( $wp_customize, 'appliances_store_return_to_header', array( 'label' => esc_html__( 'Show / Hide Return to header', 'appliances-store' ), 'section' => 'appliances_store_footer_section', 'type' => 'toggle', 'settings' => 'appliances_store_return_to_header', ) ) ); $wp_customize->add_setting('appliances_store_return_icon',array( 'default' => 'fas fa-arrow-up', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control(new Appliances_Store_Icon_Changer( $wp_customize,'appliances_store_return_icon',array( 'label' => __('Return to header Icon','appliances-store'), 'transport' => 'refresh', 'section' => 'appliances_store_footer_section', 'type' => 'icon' ))); //Mobile resposnsive $wp_customize->add_section('appliances_store_mobile_media_option',array( 'title' => __('Mobile Responsive media', 'appliances-store'), 'description' => __('Control will not function if the toggle in the main settings is off.', 'appliances-store'), 'priority' => 5, 'panel' => 'appliances_store_panel_id' ) ); $wp_customize->add_setting( 'appliances_store_return_to_header_mob', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_checkbox', ) ); $wp_customize->add_control( new Appliances_Store_Toggle_Control( $wp_customize, 'appliances_store_return_to_header_mob', array( 'label' => esc_html__( 'Show / Hide Return to header', 'appliances-store' ), 'section' => 'appliances_store_mobile_media_option', 'type' => 'toggle', 'settings' => 'appliances_store_return_to_header_mob', ) ) ); $wp_customize->add_setting( 'appliances_store_slider_buttom_mob', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_checkbox', ) ); $wp_customize->add_control( new Appliances_Store_Toggle_Control( $wp_customize, 'appliances_store_slider_buttom_mob', array( 'label' => esc_html__( 'Show / Hide Slider Button', 'appliances-store' ), 'section' => 'appliances_store_mobile_media_option', 'type' => 'toggle', 'settings' => 'appliances_store_slider_buttom_mob', ) ) ); $wp_customize->add_setting( 'appliances_store_related_post_mob', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_checkbox', ) ); $wp_customize->add_control( new Appliances_Store_Toggle_Control( $wp_customize, 'appliances_store_related_post_mob', array( 'label' => esc_html__( 'Show / Hide Related Post', 'appliances-store' ), 'section' => 'appliances_store_mobile_media_option', 'type' => 'toggle', 'settings' => 'appliances_store_related_post_mob', ) ) ); // Add Settings and Controls for Scroll top $wp_customize->add_setting('appliances_store_scroll_top_position',array( 'default' => 'Right', 'sanitize_callback' => 'appliances_store_sanitize_choices' )); $wp_customize->add_control('appliances_store_scroll_top_position',array( 'type' => 'radio', 'label' => __('Scroll to top Position', 'appliances-store'), 'description' => __('This option work for scroll to top', 'appliances-store'), 'section' => 'appliances_store_footer_section', 'choices' => array( 'Right' => __('Right','appliances-store'), 'Left' => __('Left','appliances-store'), 'Center' => __('Center','appliances-store') ), ) ); $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; //site Title $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', 'render_callback' => 'Appliances_Store_Customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'Appliances_Store_Customize_partial_blogdescription', ) ); $wp_customize->add_setting( 'appliances_store_site_title', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_checkbox', ) ); $wp_customize->add_control( new Appliances_Store_Toggle_Control( $wp_customize, 'appliances_store_site_title', array( 'label' => esc_html__( 'Show / Hide Site Title', 'appliances-store' ), 'section' => 'title_tagline', 'type' => 'toggle', 'settings' => 'appliances_store_site_title', ) ) ); // logo site title size $wp_customize->add_setting('appliances_store_site_title_font_size',array( 'default' => '', 'sanitize_callback' => 'appliances_store_sanitize_number_absint' )); $wp_customize->add_control('appliances_store_site_title_font_size',array( 'label' => __('Site Title Font Size in PX','appliances-store'), 'section' => 'title_tagline', 'setting' => 'appliances_store_site_title_font_size', 'type' => 'number', 'input_attrs' => array( 'step' => 1, 'min' => 0, 'max' => 30, ), )); $wp_customize->add_setting( 'appliances_store_site_tagline_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'appliances_store_site_tagline_color', array( 'label' => __('Change Site Title Color', 'appliances-store'), 'section' => 'title_tagline', 'settings' => 'appliances_store_site_tagline_color', ))); $wp_customize->add_setting( 'appliances_store_site_tagline', array( 'default' => false, 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_checkbox', ) ); $wp_customize->add_control( new Appliances_Store_Toggle_Control( $wp_customize, 'appliances_store_site_tagline', array( 'label' => esc_html__( 'Show / Hide Site Tagline', 'appliances-store' ), 'section' => 'title_tagline', 'type' => 'toggle', 'settings' => 'appliances_store_site_tagline', ) ) ); // logo site tagline size $wp_customize->add_setting('appliances_store_site_tagline_font_size',array( 'default' => '', 'sanitize_callback' => 'appliances_store_sanitize_number_absint' )); $wp_customize->add_control('appliances_store_site_tagline_font_size',array( 'label' => __('Site Tagline Font Size in PX','appliances-store'), 'section' => 'title_tagline', 'setting' => 'appliances_store_site_tagline_font_size', 'type' => 'number', 'input_attrs' => array( 'step' => 1, 'min' => 0, 'max' => 30, ), )); $wp_customize->add_setting( 'appliances_store_logo_tagline_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'appliances_store_logo_tagline_color', array( 'label' => __('Change Site Tagline Color', 'appliances-store'), 'section' => 'title_tagline', 'settings' => 'appliances_store_logo_tagline_color', ))); $wp_customize->add_setting('appliances_store_logo_width',array( 'default' => 80, 'sanitize_callback' => 'appliances_store_sanitize_number_absint' )); $wp_customize->add_control('appliances_store_logo_width',array( 'label' => esc_html__('Here You Can Customize Your Logo Size','appliances-store'), 'section' => 'title_tagline', 'type' => 'number' )); $wp_customize->add_setting('appliances_store_per_columns',array( 'default'=> 3, 'sanitize_callback' => 'appliances_store_sanitize_number_absint' )); $wp_customize->add_control('appliances_store_per_columns',array( 'label' => __('Product Per Row','appliances-store'), 'section'=> 'woocommerce_product_catalog', 'type'=> 'number' )); $wp_customize->add_setting('appliances_store_product_per_page',array( 'default'=> 9, 'sanitize_callback' => 'appliances_store_sanitize_number_absint' )); $wp_customize->add_control('appliances_store_product_per_page',array( 'label' => __('Product Per Page','appliances-store'), 'section'=> 'woocommerce_product_catalog', 'type'=> 'number' )); $wp_customize->add_setting( 'appliances_store_product_sidebar', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_checkbox', ) ); $wp_customize->add_control( new Appliances_Store_Toggle_Control( $wp_customize, 'appliances_store_product_sidebar', array( 'label' => esc_html__( 'Show / Hide Shop Page Sidebar', 'appliances-store' ), 'section' => 'woocommerce_product_catalog', 'type' => 'toggle', 'settings' => 'appliances_store_product_sidebar', ) ) ); $wp_customize->add_setting('appliances_store_sale_tag_position',array( 'default' => 'right', 'sanitize_callback' => 'appliances_store_sanitize_choices' )); $wp_customize->add_control('appliances_store_sale_tag_position',array( 'type' => 'radio', 'label' => __('Sale Badge Position', 'appliances-store'), 'description' => __('This option work for Archieve Products', 'appliances-store'), 'section' => 'woocommerce_product_catalog', 'choices' => array( 'left' => __('Left','appliances-store'), 'right' => __('Right','appliances-store'), ), ) ); $wp_customize->add_setting( 'appliances_store_single_product_sidebar', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_checkbox', ) ); $wp_customize->add_control( new Appliances_Store_Toggle_Control( $wp_customize, 'appliances_store_single_product_sidebar', array( 'label' => esc_html__( 'Show / Hide Product Page Sidebar', 'appliances-store' ), 'section' => 'woocommerce_product_catalog', 'type' => 'toggle', 'settings' => 'appliances_store_single_product_sidebar', ) ) ); $wp_customize->add_setting( 'appliances_store_related_product', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'appliances_store_sanitize_checkbox', ) ); $wp_customize->add_control( new Appliances_Store_Toggle_Control( $wp_customize, 'appliances_store_related_product', array( 'label' => esc_html__( 'Show / Hide related product', 'appliances-store' ), 'section' => 'woocommerce_product_catalog', 'type' => 'toggle', 'settings' => 'appliances_store_related_product', ) ) ); //Page template settings $wp_customize->add_panel( 'appliances_store_page_panel_id', array( 'priority' => 10, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __( 'Page Template Settings', 'appliances-store' ), 'description' => __( 'Description of what this panel does.', 'appliances-store' ), ) ); // 404 PAGE $wp_customize->add_section('appliances_store_404_page_section',array( 'title' => __('404 Page', 'appliances-store'), 'description' => 'Here you can customize 404 Page content.', 'panel' => 'appliances_store_page_panel_id' ) ); $wp_customize->add_setting('appliances_store_edit_404_title',array( 'default'=> __('Oops! That page cant be found.','appliances-store'), 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('appliances_store_edit_404_title',array( 'label' => __('Edit Title','appliances-store'), 'section'=> 'appliances_store_404_page_section', 'type'=> 'text', )); $wp_customize->add_setting('appliances_store_edit_404_text',array( 'default'=> __('It looks like nothing was found at this location. Maybe try a search?','appliances-store'), 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('appliances_store_edit_404_text',array( 'label' => __('Edit Text','appliances-store'), 'section'=> 'appliances_store_404_page_section', 'type'=> 'text' )); // Search Results $wp_customize->add_section('appliances_store_no_result_section',array( 'title' => __('Search Results', 'appliances-store'), 'description' => 'Here you can customize Search Result content.', 'panel' => 'appliances_store_page_panel_id' ) ); $wp_customize->add_setting('appliances_store_edit_no_result_title',array( 'default'=> __('Nothing Found','appliances-store'), 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('appliances_store_edit_no_result_title',array( 'label' => __('Edit Title','appliances-store'), 'section'=> 'appliances_store_no_result_section', 'type'=> 'text', )); $wp_customize->add_setting('appliances_store_edit_no_result_text',array( 'default'=> __('Sorry, but nothing matched your search terms. Please try again with some different keywords.','appliances-store'), 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('appliances_store_edit_no_result_text',array( 'label' => __('Edit Text','appliances-store'), 'section'=> 'appliances_store_no_result_section', 'type'=> 'text' )); // Header Image Height $wp_customize->add_setting( 'appliances_store_header_image_height', array( 'default' => 350, 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( 'appliances_store_header_image_height', array( 'label' => esc_html__( 'Header Image Height', 'appliances-store' ), 'section' => 'header_image', 'type' => 'number', 'description' => esc_html__( 'Control the height of the header image. Default is 350px.', 'appliances-store' ), 'input_attrs' => array( 'min' => 220, 'max' => 1000, 'step' => 1, ), ) ); // Header Background Position $wp_customize->add_setting( 'appliances_store_header_background_position', array( 'default' => 'center', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'appliances_store_header_background_position', array( 'label' => esc_html__( 'Header Background Position', 'appliances-store' ), 'section' => 'header_image', 'type' => 'select', 'choices' => array( 'top' => esc_html__( 'Top', 'appliances-store' ), 'center' => esc_html__( 'Center', 'appliances-store' ), 'bottom' => esc_html__( 'Bottom', 'appliances-store' ), ), 'description' => esc_html__( 'Choose how you want to position the header image.', 'appliances-store' ), ) ); // Header Image Parallax Effect $wp_customize->add_setting( 'appliances_store_header_background_attachment', array( 'default' => 1, 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( 'appliances_store_header_background_attachment', array( 'label' => esc_html__( 'Header Image Parallax', 'appliances-store' ), 'section' => 'header_image', 'type' => 'checkbox', 'description' => esc_html__( 'Add a parallax effect on page scroll.', 'appliances-store' ), ) ); } add_action( 'customize_register', 'appliances_store_customize_register' ); /** * Render the site title for the selective refresh partial. * * @since Appliances Store 1.0 * @see appliances_store_customize_register() * * @return void */ function Appliances_Store_Customize_partial_blogname() { bloginfo( 'name' ); } /** * Render the site tagline for the selective refresh partial. * * @since Appliances Store 1.0 * @see appliances_store_customize_register() * * @return void */ function Appliances_Store_Customize_partial_blogdescription() { bloginfo( 'description' ); } if ( ! defined( 'APPLIANCES_STORE_PRO_THEME_NAME' ) ) { define( 'APPLIANCES_STORE_PRO_THEME_NAME', esc_html__( 'Appliances Store Pro Theme', 'appliances-store')); } if ( ! defined( 'APPLIANCES_STORE_PRO_THEME_URL' ) ) { define( 'APPLIANCES_STORE_PRO_THEME_URL', esc_url('https://www.themespride.com/products/appliances-store-wordpress-theme', 'appliances-store')); } if ( ! defined( 'APPLIANCES_STORE_DOCS_URL' ) ) { define( 'APPLIANCES_STORE_DOCS_URL', esc_url('https://page.themespride.com/demo/docs/appliances-store-lite/')); } if ( ! defined( 'APPLIANCES_STORE_DEMO_TITLE' ) ) { define( 'APPLIANCES_STORE_DEMO_TITLE', esc_html__( 'Click to View Site', 'appliances-store' )); } /** * Singleton class for handling the theme's customizer integration. * * @since 1.0.0 * @access public */ final class Appliances_Store_Customize { /** * Returns the instance. * * @since 1.0.0 * @access public * @return object */ public static function get_instance() { static $instance = null; if ( is_null( $instance ) ) { $instance = new self; $instance->setup_actions(); } return $instance; } /** * Constructor method. * * @since 1.0.0 * @access private * @return void */ private function __construct() {} /** * Sets up initial actions. * * @since 1.0.0 * @access private * @return void */ private function setup_actions() { // Register panels, sections, settings, controls, and partials. add_action( 'customize_register', array( $this, 'sections' ) ); // Register scripts and styles for the controls. add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ), 0 ); } /** * Sets up the customizer sections. * * @since 1.0.0 * @access public * @param object $manager * @return void */ public function sections( $manager ) { // Load custom sections. load_template( trailingslashit( get_template_directory() ) . '/inc/section-pro.php' ); // Register custom section types. $manager->register_section_type( 'Appliances_Store_Customize_Section_Pro' ); // Register sections. $manager->add_section( new Appliances_Store_Customize_Section_Pro( $manager, 'appliances_store_section_pro', array( 'priority' => 9, 'title' => APPLIANCES_STORE_PRO_THEME_NAME, 'pro_text' => esc_html__( 'Upgrade Pro', 'appliances-store' ), 'pro_url' => esc_url( APPLIANCES_STORE_PRO_THEME_URL, 'appliances-store' ), ) ) ); // Register sections. $manager->add_section( new Appliances_Store_Customize_Section_Pro( $manager, 'appliances_store_documentation', array( 'priority' => 500, 'title' => esc_html__( 'Theme Documentation', 'appliances-store' ), 'pro_text' => esc_html__( 'Click Here', 'appliances-store' ), 'pro_url' => esc_url( APPLIANCES_STORE_DOCS_URL, 'appliances-store'), ) ) ); // Register sections. $manager->add_section( new Appliances_Store_Customize_Section_Pro( $manager, 'appliances_store_section_pro_demo', array( 'priority' => 9, 'title' => APPLIANCES_STORE_DEMO_TITLE, 'pro_text' => esc_html__( 'View Site', 'appliances-store' ), 'pro_url' => esc_url( home_url() ), ) ) ); } /** * Loads theme customizer CSS. * * @since 1.0.0 * @access public * @return void */ public function enqueue_control_scripts() { wp_enqueue_script( 'appliances-store-customize-controls', trailingslashit( esc_url( get_template_directory_uri() ) ) . '/assets/js/customize-controls.js', array( 'customize-controls' ) ); wp_enqueue_style( 'appliances-store-customize-controls', trailingslashit( esc_url( get_template_directory_uri() ) ) . '/assets/css/customize-controls.css' ); } } // Doing this customizer thang! Appliances_Store_Customize::get_instance();