selective_refresh ) ? 'postMessage' : 'refresh'; $wp_customize->add_panel( 'automotive_services_general', array( 'priority' => 31, 'title' => esc_html__( 'General', 'automotive-services' ), ) ); /*========================================= Breadcrumb Section =========================================*/ $wp_customize->add_section( 'automotive_services_breadcrumb_setting', array( 'title' => esc_html__( 'Breadcrumb Section', 'automotive-services' ), 'priority' => 1, 'panel' => 'automotive_services_general', ) ); // Settings $wp_customize->add_setting( 'automotive_services_breadcrumb_settings' ,array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'automotive_services_sanitize_text', 'priority' => 1, ) ); $wp_customize->add_control( 'automotive_services_breadcrumb_settings', array( 'type' => 'hidden', 'label' => __('Settings','automotive-services'), 'section' => 'automotive_services_breadcrumb_setting', ) ); // Breadcrumb Hide/ Show Setting // $wp_customize->add_setting( 'automotive_services_hs_breadcrumb' , array( 'default' => '1', 'sanitize_callback' => 'automotive_services_sanitize_checkbox', 'capability' => 'edit_theme_options', 'priority' => 2, ) ); $wp_customize->add_control( 'automotive_services_hs_breadcrumb', array( 'label' => esc_html__( 'Hide / Show Section', 'automotive-services' ), 'section' => 'automotive_services_breadcrumb_setting', 'settings' => 'automotive_services_hs_breadcrumb', 'type' => 'checkbox' ) ); $wp_customize->add_setting( 'automotive_services_breadcrumb_seprator', array( 'default' => '/', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'automotive_services_breadcrumb_seprator', array( 'label' => __('Breadcrumb separator','automotive-services'), 'section' => 'automotive_services_breadcrumb_setting', 'type' => 'text', ) ); /*========================================= Preloader Section =========================================*/ $wp_customize->add_section( 'automotive_services_preloader_section_setting', array( 'title' => esc_html__( 'Preloader', 'automotive-services' ), 'priority' => 3, 'panel' => 'automotive_services_general', ) ); // Preloader Hide/ Show Setting // $wp_customize->add_setting( 'automotive_services_preloader_setting' , array( 'default' => '0', 'sanitize_callback' => 'automotive_services_sanitize_checkbox', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'automotive_services_preloader_setting', array( 'label' => esc_html__( 'Hide / Show Preloader', 'automotive-services' ), 'section' => 'automotive_services_preloader_section_setting', 'settings' => 'automotive_services_preloader_setting', 'type' => 'checkbox' ) ); // Preloader Background Color Setting $wp_customize->add_setting( 'automotive_services_preloader_bg_color', array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'automotive_services_preloader_bg_color', array( 'label' => esc_html__('Preloader Background Color', 'automotive-services'), 'section' => 'automotive_services_preloader_section_setting', // Adjust section if needed 'settings' => 'automotive_services_preloader_bg_color', ) ) ); // Preloader Color Setting $wp_customize->add_setting( 'automotive_services_preloader_color', array( 'default' => '#D1133D', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'automotive_services_preloader_color', array( 'label' => esc_html__('Preloader Color', 'automotive-services'), 'section' => 'automotive_services_preloader_section_setting', // Adjust section if needed 'settings' => 'automotive_services_preloader_color', ) ) ); /*========================================= Scroll To Top Section =========================================*/ $wp_customize->add_section( 'automotive_services_scroll_to_top_section_setting', array( 'title' => esc_html__( 'Scroll To Top', 'automotive-services' ), 'priority' => 3, 'panel' => 'automotive_services_general', ) ); // Scroll To Top Hide/ Show Setting // $wp_customize->add_setting( 'automotive_services_scroll_top_setting' , array( 'default' => '1', 'sanitize_callback' => 'automotive_services_sanitize_checkbox', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'automotive_services_scroll_top_setting', array( 'label' => esc_html__( 'Hide / Show Scroll To Top', 'automotive-services' ), 'section' => 'automotive_services_scroll_to_top_section_setting', 'settings' => 'automotive_services_scroll_top_setting', 'type' => 'checkbox' ) ); // Scroll To Top Color Setting $wp_customize->add_setting( 'automotive_services_scroll_top_color', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'automotive_services_scroll_top_color', array( 'label' => esc_html__( 'Scroll To Top Color', 'automotive-services' ), 'section' => 'automotive_services_scroll_to_top_section_setting', 'settings' => 'automotive_services_scroll_top_color', ) ) ); // Scroll To Top Background Color Setting $wp_customize->add_setting( 'automotive_services_scroll_top_bg_color', array( 'default' => '#D1133D', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'automotive_services_scroll_top_bg_color', array( 'label' => esc_html__( 'Scroll To Top Background Color', 'automotive-services' ), 'section' => 'automotive_services_scroll_to_top_section_setting', 'settings' => 'automotive_services_scroll_top_bg_color', ) ) ); /*========================================= Woocommerce Section =========================================*/ $wp_customize->add_section( 'woocommerce_section_setting', array( 'title' => esc_html__( 'Woocommerce Additional Settings', 'automotive-services' ), 'priority' => 3, 'panel' => 'woocommerce', ) ); // Add the setting for product columns $wp_customize->add_setting( 'automotive_services_custom_shop_per_columns', array( 'default' => '3', 'sanitize_callback' => 'automotive_services_sanitize_numeric_input', ) ); // Add control for product columns $wp_customize->add_control( 'automotive_services_custom_shop_per_columns', array( 'label' => __('Product Per Columns', 'automotive-services'), 'section' => 'woocommerce_section_setting', 'type' => 'number', // Change type to number 'input_attrs' => array( 'min' => 1, // Optional: set minimum allowed value 'max' => 4, 'step' => 1, // Optional: set step size ), 'transport' => $selective_refresh, ) ); $wp_customize->add_setting( 'automotive_services_custom_shop_product_per_page', array( 'default' => '9', 'sanitize_callback' => 'automotive_services_sanitize_numeric_input', ) ); $wp_customize->add_control( 'automotive_services_custom_shop_product_per_page', array( 'label' => __('Product Per Page','automotive-services'), 'section' => 'woocommerce_section_setting', 'type' => 'number', // Change type to number 'input_attrs' => array( 'min' => 1, // Optional: set minimum allowed value 'step' => 1, // Optional: set step size ), 'transport' => $selective_refresh, ) ); // Woocommerce Sidebar Hide/ Show Setting // $wp_customize->add_setting( 'automotive_services_wocommerce_sidebar_setting' , array( 'default' => '1', 'sanitize_callback' => 'automotive_services_sanitize_checkbox', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'automotive_services_wocommerce_sidebar_setting', array( 'label' => esc_html__( 'Hide / Show Woocommerce Sidebar', 'automotive-services' ), 'section' => 'woocommerce_section_setting', 'settings' => 'automotive_services_wocommerce_sidebar_setting', 'type' => 'checkbox' ) ); /*========================================= 404 Section =========================================*/ $wp_customize->add_section( 'automotive_services_404_section', array( 'title' => esc_html__( '404 Section', 'automotive-services' ), 'priority' => 1, 'panel' => 'automotive_services_general', ) ); $wp_customize->add_setting( 'automotive_services_404_title', array( 'default' => '404', 'sanitize_callback' => 'sanitize_text_field', 'priority' => 2, ) ); $wp_customize->add_control( 'automotive_services_404_title', array( 'label' => __('404 Heading','automotive-services'), 'section' => 'automotive_services_404_section', 'type' => 'text', 'transport' => $selective_refresh, ) ); $wp_customize->add_setting( 'automotive_services_404_Text', array( 'default' => 'Page Not Found', 'sanitize_callback' => 'sanitize_text_field', 'priority' => 2, ) ); $wp_customize->add_control( 'automotive_services_404_Text', array( 'label' => __('404 Title','automotive-services'), 'section' => 'automotive_services_404_section', 'type' => 'text', 'transport' => $selective_refresh, ) ); $wp_customize->add_setting( 'automotive_services_404_content', array( 'default' => 'The page you were looking for could not be found.', 'sanitize_callback' => 'sanitize_text_field', 'priority' => 2, ) ); $wp_customize->add_control( 'automotive_services_404_content', array( 'label' => __('404 Content','automotive-services'), 'section' => 'automotive_services_404_section', 'type' => 'text', 'transport' => $selective_refresh, ) ); } add_action( 'customize_register', 'automotive_services_general_setting' );