get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; //Selective Refresh $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.logo .site-title a', 'render_callback' => 'Auto_Parts_Garage_Customize_partial_blogname', )); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => 'p.site-description', 'render_callback' => 'Auto_Parts_Garage_Customize_partial_blogdescription', )); // add home page setting pannel $wp_customize->add_panel( 'auto_parts_garage_panel_id', array( 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => esc_html__( 'VW Settings', 'auto-parts-garage' ), 'priority' => 10, )); // Layout $wp_customize->add_section( 'auto_parts_garage_left_right', array( 'title' => esc_html__('General Settings', 'auto-parts-garage'), 'panel' => 'auto_parts_garage_panel_id' ) ); $wp_customize->add_setting('auto_parts_garage_width_option',array( 'default' => 'Full Width', 'sanitize_callback' => 'auto_parts_garage_sanitize_choices' )); $wp_customize->add_control(new Auto_Parts_Garage_Image_Radio_Control($wp_customize, 'auto_parts_garage_width_option', array( 'type' => 'select', 'label' => esc_html__('Width Layouts','auto-parts-garage'), 'description' => esc_html__('Here you can change the width layout of Website.','auto-parts-garage'), 'section' => 'auto_parts_garage_left_right', 'choices' => array( 'Full Width' => esc_url(get_template_directory_uri()).'/assets/images/full-width.png', 'Wide Width' => esc_url(get_template_directory_uri()).'/assets/images/wide-width.png', 'Boxed' => esc_url(get_template_directory_uri()).'/assets/images/boxed-width.png', )))); $wp_customize->add_setting('auto_parts_garage_theme_options',array( 'default' => 'Right Sidebar', 'sanitize_callback' => 'auto_parts_garage_sanitize_choices' )); $wp_customize->add_control('auto_parts_garage_theme_options',array( 'type' => 'select', 'label' => esc_html__('Post Sidebar Layout','auto-parts-garage'), 'description' => esc_html__('Here you can change the sidebar layout for posts. ','auto-parts-garage'), 'section' => 'auto_parts_garage_left_right', 'choices' => array( 'Left Sidebar' => esc_html__('Left Sidebar','auto-parts-garage'), 'Right Sidebar' => esc_html__('Right Sidebar','auto-parts-garage'), 'One Column' => esc_html__('One Column','auto-parts-garage'), 'Grid Layout' => esc_html__('Grid Layout','auto-parts-garage') ), ) ); $wp_customize->add_setting('auto_parts_garage_page_layout',array( 'default' => 'One_Column', 'sanitize_callback' => 'auto_parts_garage_sanitize_choices' )); $wp_customize->add_control('auto_parts_garage_page_layout',array( 'type' => 'select', 'label' => esc_html__('Page Sidebar Layout','auto-parts-garage'), 'description' => esc_html__('Here you can change the sidebar layout for pages. ','auto-parts-garage'), 'section' => 'auto_parts_garage_left_right', 'choices' => array( 'Left_Sidebar' => esc_html__('Left Sidebar','auto-parts-garage'), 'Right_Sidebar' => esc_html__('Right Sidebar','auto-parts-garage'), 'One_Column' => esc_html__('One Column','auto-parts-garage') ), ) ); // Selective Refresh $wp_customize->selective_refresh->add_partial( 'auto_parts_garage_woocommerce_shop_page_sidebar', array( 'selector' => '.post-type-archive-product #sidebar', 'render_callback' => 'Auto_Parts_Garage_Customize_partial_auto_parts_garage_woocommerce_shop_page_sidebar', ) ); // Woocommerce Shop Page Sidebar $wp_customize->add_setting( 'auto_parts_garage_woocommerce_shop_page_sidebar',array( 'default' => 1, 'transport' => 'refresh', 'sanitize_callback' => 'auto_parts_garage_switch_sanitization' ) ); $wp_customize->add_control( new Auto_Parts_Garage_Toggle_Switch_Custom_Control( $wp_customize, 'auto_parts_garage_woocommerce_shop_page_sidebar',array( 'label' => esc_html__( 'Shop Page Sidebar','auto-parts-garage' ), 'section' => 'auto_parts_garage_left_right' ))); // Selective Refresh $wp_customize->selective_refresh->add_partial( 'auto_parts_garage_woocommerce_single_product_page_sidebar', array( 'selector' => '.single-product #sidebar', 'render_callback' => 'Auto_Parts_Garage_Customize_partial_auto_parts_garage_woocommerce_single_product_page_sidebar', ) ); //Woocommerce Single Product page Sidebar $wp_customize->add_setting( 'auto_parts_garage_woocommerce_single_product_page_sidebar',array( 'default' => 1, 'transport' => 'refresh', 'sanitize_callback' => 'auto_parts_garage_switch_sanitization' ) ); $wp_customize->add_control( new Auto_Parts_Garage_Toggle_Switch_Custom_Control( $wp_customize, 'auto_parts_garage_woocommerce_single_product_page_sidebar',array( 'label' => esc_html__( 'Single Product Sidebar','auto-parts-garage' ), 'section' => 'auto_parts_garage_left_right' ))); // Pre-Loader $wp_customize->add_setting( 'auto_parts_garage_loader_enable',array( 'default' => 0, 'transport' => 'refresh', 'sanitize_callback' => 'auto_parts_garage_switch_sanitization' ) ); $wp_customize->add_control( new Auto_Parts_Garage_Toggle_Switch_Custom_Control( $wp_customize, 'auto_parts_garage_loader_enable',array( 'label' => esc_html__( 'Pre-Loader','auto-parts-garage' ), 'section' => 'auto_parts_garage_left_right' ))); $wp_customize->add_setting('auto_parts_garage_preloader_bg_color', array( 'default' => '#282828', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'auto_parts_garage_preloader_bg_color', array( 'label' => __('Pre-Loader Background Color', 'auto-parts-garage'), 'section' => 'auto_parts_garage_left_right', ))); $wp_customize->add_setting('auto_parts_garage_preloader_border_color', array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'auto_parts_garage_preloader_border_color', array( 'label' => __('Pre-Loader Border Color', 'auto-parts-garage'), 'section' => 'auto_parts_garage_left_right', ))); //Topbar $wp_customize->add_section( 'auto_parts_garage_topbar_section' , array( 'title' => __( 'Topbar Section', 'auto-parts-garage' ), 'panel' => 'auto_parts_garage_panel_id' ) ); $wp_customize->add_setting( 'auto_parts_garage_topbar_hide_show',array( 'default' => 0, 'transport' => 'refresh', 'sanitize_callback' => 'auto_parts_garage_switch_sanitization' )); $wp_customize->add_control( new Auto_Parts_Garage_Toggle_Switch_Custom_Control( $wp_customize, 'auto_parts_garage_topbar_hide_show',array( 'label' => esc_html__( 'Show / Hide Topbar','auto-parts-garage' ), 'section' => 'auto_parts_garage_topbar_section' ))); //Header $wp_customize->add_section( 'auto_parts_garage_header_settings' , array( 'title' => __( 'Header', 'auto-parts-garage' ), 'panel' => 'auto_parts_garage_panel_id' ) ); $wp_customize->add_setting('auto_parts_garage_phone_text',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('auto_parts_garage_phone_text',array( 'label' => esc_html__('Add Phone Text','auto-parts-garage'), 'input_attrs' => array( 'placeholder' => esc_html__( 'Phone', 'auto-parts-garage' ), ), 'section'=> 'auto_parts_garage_header_settings', 'type'=> 'text' )); $wp_customize->add_setting('auto_parts_garage_phone_number',array( 'default'=> '', 'sanitize_callback' => 'auto_parts_garage_sanitize_number_absint' )); $wp_customize->add_control('auto_parts_garage_phone_number',array( 'label' => esc_html__('Phone Number','auto-parts-garage'), 'input_attrs' => array( 'placeholder' => esc_html__( '+12 123 456 7890', 'auto-parts-garage' ), ), 'section'=> 'auto_parts_garage_header_settings', 'type'=> 'text' )); //Slider $wp_customize->add_section( 'auto_parts_garage_slidersettings' , array( 'title' => __( 'Slider Settings', 'auto-parts-garage' ), 'panel' => 'auto_parts_garage_panel_id' ) ); $wp_customize->add_setting( 'auto_parts_garage_slider_hide_show',array( 'default' => 0, 'transport' => 'refresh', 'sanitize_callback' => 'auto_parts_garage_switch_sanitization' )); $wp_customize->add_control( new Auto_Parts_Garage_Toggle_Switch_Custom_Control( $wp_customize, 'auto_parts_garage_slider_hide_show',array( 'label' => esc_html__( 'Show / Hide Slider','auto-parts-garage' ), 'section' => 'auto_parts_garage_slidersettings' ))); //Selective Refresh $wp_customize->selective_refresh->add_partial('auto_parts_garage_slider_hide_show',array( 'selector' => '.slider-btn a', 'render_callback' => 'Auto_Parts_Garage_Customize_partial_auto_parts_garage_slider_hide_show', )); for ( $count = 1; $count <= 3; $count++ ) { $wp_customize->add_setting( 'auto_parts_garage_slider_page' . $count, array( 'default' => '', 'sanitize_callback' => 'auto_parts_garage_sanitize_dropdown_pages' ) ); $wp_customize->add_control( 'auto_parts_garage_slider_page' . $count, array( 'label' => __( 'Select Slider Page', 'auto-parts-garage' ), 'description' => __('Slider image size (1400 x 550)','auto-parts-garage'), 'section' => 'auto_parts_garage_slidersettings', 'type' => 'dropdown-pages' ) ); } $wp_customize->add_setting( 'auto_parts_garage_slider_speed', array( 'default' => 4000, 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'auto_parts_garage_slider_speed', array( 'label' => esc_html__('Slider Transition Speed','auto-parts-garage'), 'section' => 'auto_parts_garage_slidersettings', 'type' => 'text', ) ); //Seller Products Section $wp_customize->add_section('auto_parts_garage_best_seller_products_section',array( 'title' => __('Products Seller Section','auto-parts-garage'), 'panel' => 'auto_parts_garage_panel_id', )); $wp_customize->add_setting('auto_parts_garage_product_title',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('auto_parts_garage_product_title',array( 'label' => __('Add Sale Products Title','auto-parts-garage'), 'input_attrs' => array( 'placeholder' => __( 'Sale Products', 'auto-parts-garage' ), ), 'section'=> 'auto_parts_garage_best_seller_products_section', 'type'=> 'text' )); $args = array( 'type' => 'product', 'child_of' => 0, 'parent' => '', 'orderby' => 'term_group', 'order' => 'ASC', 'hide_empty' => false, 'hierarchical' => 1, 'number' => '', 'taxonomy' => 'product_cat', 'pad_counts' => false ); $categories = get_categories($args); $cats = array(); $i = 0; $cat_post[]= 'select'; foreach($categories as $category){ if($i==0){ $default = $category->slug; $i++; } $cat_post[$category->slug] = $category->name; } $wp_customize->add_setting('auto_parts_garage_bestseller_product_page',array( 'default' => 'select', 'sanitize_callback' => 'auto_parts_garage_sanitize_choices', )); $wp_customize->add_control('auto_parts_garage_bestseller_product_page',array( 'type' => 'select', 'choices' => $cat_post, 'label' => __('Select Category to display Products','auto-parts-garage'), 'section' => 'auto_parts_garage_best_seller_products_section', )); $wp_customize->add_setting('auto_parts_garage_discount_sale_img',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'auto_parts_garage_discount_sale_img',array( 'label' => __('Select Product Image','auto-parts-garage'), 'description' => __('Select Product Sale Image (320 x 300)','auto-parts-garage'), 'section' => 'auto_parts_garage_best_seller_products_section' ))); $wp_customize->add_setting('auto_parts_garage_product_sale_discount_text',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('auto_parts_garage_product_sale_discount_text',array( 'label' => __('Add Sale Products Discount Text','auto-parts-garage'), 'input_attrs' => array( 'placeholder' => __( '30% OFF', 'auto-parts-garage' ), ), 'section'=> 'auto_parts_garage_best_seller_products_section', 'type'=> 'text' )); $wp_customize->add_setting('auto_parts_garage_product_btn_text',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('auto_parts_garage_product_btn_text',array( 'label' => esc_html__('Add Product Button Text','auto-parts-garage'), 'input_attrs' => array( 'placeholder' => esc_html__( 'VIEW DETAILS', 'auto-parts-garage' ), ), 'section'=> 'auto_parts_garage_best_seller_products_section', 'type'=> 'text' )); $wp_customize->add_setting('auto_parts_garage_product_btn_link',array( 'default'=> '', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('auto_parts_garage_product_btn_link',array( 'label' => esc_html__('Add Product Button Link','auto-parts-garage'), 'input_attrs' => array( 'placeholder' => esc_html__( 'www.example.com', 'auto-parts-garage' ), ), 'section'=> 'auto_parts_garage_best_seller_products_section', 'type'=> 'url' )); $wp_customize->add_setting('auto_parts_garage_top_rated_pro_title',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('auto_parts_garage_top_rated_pro_title',array( 'label' => __('Add Top Rated Products Title','auto-parts-garage'), 'input_attrs' => array( 'placeholder' => __( 'Top Rated Products', 'auto-parts-garage' ), ), 'section'=> 'auto_parts_garage_best_seller_products_section', 'type'=> 'text' )); $args = array( 'type' => 'product', 'child_of' => 0, 'parent' => '', 'orderby' => 'term_group', 'order' => 'ASC', 'hide_empty' => false, 'hierarchical' => 1, 'number' => '', 'taxonomy' => 'product_cat', 'pad_counts' => false ); $categories = get_categories($args); $cats = array(); $i = 0; $cat_post[]= 'select'; foreach($categories as $category){ if($i==0){ $default = $category->slug; $i++; } $cat_post[$category->slug] = $category->name; } $wp_customize->add_setting('auto_parts_garage_to_rated_product_page',array( 'default' => 'select', 'sanitize_callback' => 'auto_parts_garage_sanitize_choices', )); $wp_customize->add_control('auto_parts_garage_to_rated_product_page',array( 'type' => 'select', 'choices' => $cat_post, 'label' => __('Select Category to Top Rated Products','auto-parts-garage'), 'section' => 'auto_parts_garage_best_seller_products_section', )); //Blog Post $wp_customize->add_panel( 'auto_parts_garage_blog_post_parent_panel', array( 'title' => esc_html__( 'Blog Post Settings', 'auto-parts-garage' ), 'panel' => 'auto_parts_garage_panel_id', 'priority' => 20, )); // Add example section and controls to the middle (second) panel $wp_customize->add_section( 'auto_parts_garage_post_settings', array( 'title' => esc_html__( 'Post Settings', 'auto-parts-garage' ), 'panel' => 'auto_parts_garage_blog_post_parent_panel', )); //Selective Refresh $wp_customize->selective_refresh->add_partial('auto_parts_garage_toggle_postdate', array( 'selector' => '.post-main-box h2 a', 'render_callback' => 'Auto_Parts_Garage_Customize_partial_auto_parts_garage_toggle_postdate', )); $wp_customize->add_setting( 'auto_parts_garage_toggle_postdate',array( 'default' => 1, 'transport' => 'refresh', 'sanitize_callback' => 'auto_parts_garage_switch_sanitization' ) ); $wp_customize->add_control( new Auto_Parts_Garage_Toggle_Switch_Custom_Control( $wp_customize, 'auto_parts_garage_toggle_postdate',array( 'label' => esc_html__( 'Post Date','auto-parts-garage' ), 'section' => 'auto_parts_garage_post_settings' ))); $wp_customize->add_setting( 'auto_parts_garage_toggle_author',array( 'default' => 1, 'transport' => 'refresh', 'sanitize_callback' => 'auto_parts_garage_switch_sanitization' ) ); $wp_customize->add_control( new Auto_Parts_Garage_Toggle_Switch_Custom_Control( $wp_customize, 'auto_parts_garage_toggle_author',array( 'label' => esc_html__( 'Author','auto-parts-garage' ), 'section' => 'auto_parts_garage_post_settings' ))); $wp_customize->add_setting( 'auto_parts_garage_toggle_comments',array( 'default' => 1, 'transport' => 'refresh', 'sanitize_callback' => 'auto_parts_garage_switch_sanitization' ) ); $wp_customize->add_control( new Auto_Parts_Garage_Toggle_Switch_Custom_Control( $wp_customize, 'auto_parts_garage_toggle_comments',array( 'label' => esc_html__( 'Comments','auto-parts-garage' ), 'section' => 'auto_parts_garage_post_settings' ))); $wp_customize->add_setting( 'auto_parts_garage_toggle_time',array( 'default' => 1, 'transport' => 'refresh', 'sanitize_callback' => 'auto_parts_garage_switch_sanitization' ) ); $wp_customize->add_control( new Auto_Parts_Garage_Toggle_Switch_Custom_Control( $wp_customize, 'auto_parts_garage_toggle_time',array( 'label' => esc_html__( 'Time','auto-parts-garage' ), 'section' => 'auto_parts_garage_post_settings' ))); $wp_customize->add_setting( 'auto_parts_garage_featured_image_hide_show',array( 'default' => 1, 'transport' => 'refresh', 'sanitize_callback' => 'auto_parts_garage_switch_sanitization' )); $wp_customize->add_control( new Auto_Parts_Garage_Toggle_Switch_Custom_Control( $wp_customize, 'auto_parts_garage_featured_image_hide_show', array( 'label' => esc_html__( 'Featured Image','auto-parts-garage' ), 'section' => 'auto_parts_garage_post_settings' ))); $wp_customize->add_setting( 'auto_parts_garage_toggle_tags',array( 'default' => 1, 'transport' => 'refresh', 'sanitize_callback' => 'auto_parts_garage_switch_sanitization' )); $wp_customize->add_control( new Auto_Parts_Garage_Toggle_Switch_Custom_Control( $wp_customize, 'auto_parts_garage_toggle_tags', array( 'label' => esc_html__( 'Tags','auto-parts-garage' ), 'section' => 'auto_parts_garage_post_settings' ))); $wp_customize->add_setting( 'auto_parts_garage_excerpt_number', array( 'default' => 30, 'type' => 'theme_mod', 'transport' => 'refresh', 'sanitize_callback' => 'auto_parts_garage_sanitize_number_range', 'sanitize_js_callback' => 'absint', ) ); $wp_customize->add_control( 'auto_parts_garage_excerpt_number', array( 'label' => esc_html__( 'Excerpt length','auto-parts-garage' ), 'section' => 'auto_parts_garage_post_settings', 'type' => 'range', 'settings' => 'auto_parts_garage_excerpt_number', 'input_attrs' => array( 'step' => 5, 'min' => 0, 'max' => 50, ), ) ); $wp_customize->add_setting('auto_parts_garage_meta_field_separator',array( 'default'=> '|', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('auto_parts_garage_meta_field_separator',array( 'label' => __('Add Meta Separator','auto-parts-garage'), 'description' => __('Add the seperator for meta box. Example: "|", "/", etc.','auto-parts-garage'), 'section'=> 'auto_parts_garage_post_settings', 'type'=> 'text' )); $wp_customize->add_setting('auto_parts_garage_excerpt_settings',array( 'default' => 'Excerpt', 'transport' => 'refresh', 'sanitize_callback' => 'auto_parts_garage_sanitize_choices' )); $wp_customize->add_control('auto_parts_garage_excerpt_settings',array( 'type' => 'select', 'label' => esc_html__('Post Content','auto-parts-garage'), 'section' => 'auto_parts_garage_post_settings', 'choices' => array( 'Content' => esc_html__('Content','auto-parts-garage'), 'Excerpt' => esc_html__('Excerpt','auto-parts-garage'), 'No Content' => esc_html__('No Content','auto-parts-garage') ), ) ); // Button Settings $wp_customize->add_section( 'auto_parts_garage_button_settings', array( 'title' => esc_html__( 'Button Settings', 'auto-parts-garage' ), 'panel' => 'auto_parts_garage_blog_post_parent_panel', )); //Selective Refresh $wp_customize->selective_refresh->add_partial('auto_parts_garage_button_text', array( 'selector' => '.post-main-box .more-btn a', 'render_callback' => 'Auto_Parts_Garage_Customize_partial_auto_parts_garage_button_text', )); $wp_customize->add_setting('auto_parts_garage_button_text',array( 'default'=> esc_html__('Read More','auto-parts-garage'), 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('auto_parts_garage_button_text',array( 'label' => esc_html__('Add Button Text','auto-parts-garage'), 'input_attrs' => array( 'placeholder' => esc_html__( 'Read More', 'auto-parts-garage' ), ), 'section'=> 'auto_parts_garage_button_settings', 'type'=> 'text' )); // Related Post Settings $wp_customize->add_section( 'auto_parts_garage_related_posts_settings', array( 'title' => esc_html__( 'Related Posts Settings', 'auto-parts-garage' ), 'panel' => 'auto_parts_garage_blog_post_parent_panel', )); //Selective Refresh $wp_customize->selective_refresh->add_partial('auto_parts_garage_related_post_title', array( 'selector' => '.related-post h3', 'render_callback' => 'Auto_Parts_Garage_Customize_partial_auto_parts_garage_related_post_title', )); $wp_customize->add_setting( 'auto_parts_garage_related_post',array( 'default' => 1, 'transport' => 'refresh', 'sanitize_callback' => 'auto_parts_garage_switch_sanitization' ) ); $wp_customize->add_control( new Auto_Parts_Garage_Toggle_Switch_Custom_Control( $wp_customize, 'auto_parts_garage_related_post',array( 'label' => esc_html__( 'Related Post','auto-parts-garage' ), 'section' => 'auto_parts_garage_related_posts_settings' ))); $wp_customize->add_setting('auto_parts_garage_related_post_title',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('auto_parts_garage_related_post_title',array( 'label' => esc_html__('Add Related Post Title','auto-parts-garage'), 'input_attrs' => array( 'placeholder' => esc_html__( 'Related Post', 'auto-parts-garage' ), ), 'section'=> 'auto_parts_garage_related_posts_settings', 'type'=> 'text' )); $wp_customize->add_setting('auto_parts_garage_related_posts_count',array( 'default'=> 3, 'sanitize_callback' => 'auto_parts_garage_sanitize_number_absint' )); $wp_customize->add_control('auto_parts_garage_related_posts_count',array( 'label' => esc_html__('Add Related Post Count','auto-parts-garage'), 'input_attrs' => array( 'placeholder' => esc_html__( '3', 'auto-parts-garage' ), ), 'section'=> 'auto_parts_garage_related_posts_settings', 'type'=> 'number' )); //Responsive Media Settings $wp_customize->add_section('auto_parts_garage_responsive_media',array( 'title' => esc_html__('Responsive Media','auto-parts-garage'), 'panel' => 'auto_parts_garage_panel_id', )); $wp_customize->add_setting( 'auto_parts_garage_resp_slider_hide_show',array( 'default' => 0, 'transport' => 'refresh', 'sanitize_callback' => 'auto_parts_garage_switch_sanitization' )); $wp_customize->add_control( new Auto_Parts_Garage_Toggle_Switch_Custom_Control( $wp_customize, 'auto_parts_garage_resp_slider_hide_show',array( 'label' => esc_html__( 'Show / Hide Slider','auto-parts-garage' ), 'section' => 'auto_parts_garage_responsive_media' ))); $wp_customize->add_setting( 'auto_parts_garage_sidebar_hide_show',array( 'default' => 1, 'transport' => 'refresh', 'sanitize_callback' => 'auto_parts_garage_switch_sanitization' )); $wp_customize->add_control( new Auto_Parts_Garage_Toggle_Switch_Custom_Control( $wp_customize, 'auto_parts_garage_sidebar_hide_show',array( 'label' => esc_html__( 'Show / Hide Sidebar','auto-parts-garage' ), 'section' => 'auto_parts_garage_responsive_media' ))); $wp_customize->add_setting( 'auto_parts_garage_resp_scroll_top_hide_show',array( 'default' => 1, 'transport' => 'refresh', 'sanitize_callback' => 'auto_parts_garage_switch_sanitization' )); $wp_customize->add_control( new Auto_Parts_Garage_Toggle_Switch_Custom_Control( $wp_customize, 'auto_parts_garage_resp_scroll_top_hide_show',array( 'label' => esc_html__( 'Show / Hide Scroll To Top','auto-parts-garage' ), 'section' => 'auto_parts_garage_responsive_media' ))); //Footer Text $wp_customize->add_section('auto_parts_garage_footer',array( 'title' => esc_html__('Footer Settings','auto-parts-garage'), 'panel' => 'auto_parts_garage_panel_id', )); //Selective Refresh $wp_customize->selective_refresh->add_partial('auto_parts_garage_footer_text', array( 'selector' => '.copyright p', 'render_callback' => 'Auto_Parts_Garage_Customize_partial_auto_parts_garage_footer_text', )); $wp_customize->add_setting('auto_parts_garage_footer_text',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('auto_parts_garage_footer_text',array( 'label' => esc_html__('Copyright Text','auto-parts-garage'), 'input_attrs' => array( 'placeholder' => esc_html__( 'Copyright 2021, .....', 'auto-parts-garage' ), ), 'section'=> 'auto_parts_garage_footer', 'type'=> 'text' )); $wp_customize->add_setting('auto_parts_garage_copyright_alingment',array( 'default' => 'center', 'sanitize_callback' => 'auto_parts_garage_sanitize_choices' )); $wp_customize->add_control(new Auto_Parts_Garage_Image_Radio_Control($wp_customize, 'auto_parts_garage_copyright_alingment', array( 'type' => 'select', 'label' => esc_html__('Copyright Alignment','auto-parts-garage'), 'section' => 'auto_parts_garage_footer', 'settings' => 'auto_parts_garage_copyright_alingment', 'choices' => array( 'left' => esc_url(get_template_directory_uri()).'/assets/images/copyright1.png', 'center' => esc_url(get_template_directory_uri()).'/assets/images/copyright2.png', 'right' => esc_url(get_template_directory_uri()).'/assets/images/copyright3.png' )))); $wp_customize->add_setting( 'auto_parts_garage_hide_show_scroll',array( 'default' => 1, 'transport' => 'refresh', 'sanitize_callback' => 'auto_parts_garage_switch_sanitization' )); $wp_customize->add_control( new Auto_Parts_Garage_Toggle_Switch_Custom_Control( $wp_customize, 'auto_parts_garage_hide_show_scroll',array( 'label' => esc_html__( 'Show / Hide Scroll to Top','auto-parts-garage' ), 'section' => 'auto_parts_garage_footer' ))); //Selective Refresh $wp_customize->selective_refresh->add_partial('auto_parts_garage_scroll_to_top_icon', array( 'selector' => '.scrollup i', 'render_callback' => 'Auto_Parts_Garage_Customize_partial_auto_parts_garage_scroll_to_top_icon', )); $wp_customize->add_setting('auto_parts_garage_scroll_top_alignment',array( 'default' => 'Right', 'sanitize_callback' => 'auto_parts_garage_sanitize_choices' )); $wp_customize->add_control(new Auto_Parts_Garage_Image_Radio_Control($wp_customize, 'auto_parts_garage_scroll_top_alignment', array( 'type' => 'select', 'label' => esc_html__('Scroll To Top','auto-parts-garage'), 'section' => 'auto_parts_garage_footer', 'settings' => 'auto_parts_garage_scroll_top_alignment', 'choices' => array( 'Left' => esc_url(get_template_directory_uri()).'/assets/images/layout1.png', 'Center' => esc_url(get_template_directory_uri()).'/assets/images/layout2.png', 'Right' => esc_url(get_template_directory_uri()).'/assets/images/layout3.png' )))); } add_action( 'customize_register', 'Auto_Parts_Garage_Customize_register' ); load_template( trailingslashit( get_template_directory() ) . '/inc/logo/logo-resizer.php' ); /** * Singleton class for handling the theme's customizer integration. * * @since 1.0.0 * @access public */ final class Auto_Parts_Garage_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( 'Auto_Parts_Garage_Customize_Section_Pro' ); // Register sections. $manager->add_section( new Auto_Parts_Garage_Customize_Section_Pro( $manager,'auto_parts_garage_go_pro', array( 'priority' => 1, 'title' => esc_html__( 'AUTO PARTS PRO', 'auto-parts-garage' ), 'pro_text' => esc_html__( 'UPGRADE PRO', 'auto-parts-garage' ), 'pro_url' => esc_url('https://www.vwthemes.com/themes/garage-wordpress-theme/'), ) ) ); } /** * Loads theme customizer CSS. * * @since 1.0.0 * @access public * @return void */ public function enqueue_control_scripts() { wp_enqueue_script( 'auto-parts-garage-customize-controls', trailingslashit( get_template_directory_uri() ) . '/assets/js/customize-controls.js', array( 'customize-controls' ) ); wp_enqueue_style( 'auto-parts-garage-customize-controls', trailingslashit( get_template_directory_uri() ) . '/assets/css/customize-controls.css' ); } } // Doing this customizer thang! Auto_Parts_Garage_Customize::get_instance();