add_section( 'aster_ebooks_general_options', array( 'panel' => 'aster_ebooks_theme_options', 'title' => esc_html__( 'General Options', 'aster-ebooks' ), ) ); // General Options - Enable Preloader. $wp_customize->add_setting( 'aster_ebooks_enable_preloader', array( 'sanitize_callback' => 'aster_ebooks_sanitize_switch', 'default' => false, ) ); $wp_customize->add_control( new Aster_Ebooks_Toggle_Switch_Custom_Control( $wp_customize, 'aster_ebooks_enable_preloader', array( 'label' => esc_html__( 'Enable Preloader', 'aster-ebooks' ), 'section' => 'aster_ebooks_general_options', ) ) ); // Add setting for sticky header $wp_customize->add_setting( 'aster_ebooks_enable_sticky_header', array( 'sanitize_callback' => 'aster_ebooks_sanitize_switch', 'default' => false, ) ); // Add control for sticky header setting $wp_customize->add_control( new aster_ebooks_Toggle_Switch_Custom_Control( $wp_customize, 'aster_ebooks_enable_sticky_header', array( 'label' => esc_html__( 'Enable Sticky Header', 'aster-ebooks' ), 'section' => 'aster_ebooks_general_options', ) ) ); // Site Title - Enable Setting. $wp_customize->add_setting( 'aster_ebooks_enable_site_title_setting', array( 'default' => true, 'sanitize_callback' => 'aster_ebooks_sanitize_switch', ) ); $wp_customize->add_control( new Aster_Ebooks_Toggle_Switch_Custom_Control( $wp_customize, 'aster_ebooks_enable_site_title_setting', array( 'label' => esc_html__( 'Disable Site Title', 'aster-ebooks' ), 'section' => 'title_tagline', 'settings' => 'aster_ebooks_enable_site_title_setting', ) ) ); $wp_customize->add_setting( 'aster_ebooks_site_title_size', array( 'default' => 30, // Default font size in pixels 'sanitize_callback' => 'absint', // Sanitize the input as a positive integer ) ); // Add control for site title size $wp_customize->add_control( 'aster_ebooks_site_title_size', array( 'type' => 'number', 'section' => 'title_tagline', // You can change this section to your preferred section 'label' => __( 'Site Title Font Size ', 'aster-ebooks' ), 'input_attrs' => array( 'min' => 10, 'max' => 100, 'step' => 1, ), ) ); // Tagline - Enable Setting. $wp_customize->add_setting( 'aster_ebooks_enable_tagline_setting', array( 'default' => false, 'sanitize_callback' => 'aster_ebooks_sanitize_switch', ) ); $wp_customize->add_control( new Aster_Ebooks_Toggle_Switch_Custom_Control( $wp_customize, 'aster_ebooks_enable_tagline_setting', array( 'label' => esc_html__( 'Enable Tagline', 'aster-ebooks' ), 'section' => 'title_tagline', 'settings' => 'aster_ebooks_enable_tagline_setting', ) ) ); $wp_customize->add_section( 'aster_ebooks_header_options', array( 'panel' => 'aster_ebooks_theme_options', 'title' => esc_html__( 'Header Options', 'aster-ebooks' ), ) ); // Header Options - Enable Topbar. $wp_customize->add_setting( 'aster_ebooks_enable_topbar', array( 'sanitize_callback' => 'aster_ebooks_sanitize_switch', 'default' => false, ) ); $wp_customize->add_control( new Aster_Ebooks_Toggle_Switch_Custom_Control( $wp_customize, 'aster_ebooks_enable_topbar', array( 'label' => esc_html__( 'Enable Topbar', 'aster-ebooks' ), 'section' => 'aster_ebooks_header_options', ) ) ); // Header Options - Contact Number. $wp_customize->add_setting( 'aster_ebooks_discount_topbar_text', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'aster_ebooks_discount_topbar_text', array( 'label' => esc_html__( 'Topbar Discount Text', 'aster-ebooks' ), 'section' => 'aster_ebooks_header_options', 'type' => 'text', 'active_callback' => 'aster_ebooks_is_topbar_enabled', ) );