add_section( 'aster_startup_single_post_options', array( 'title' => esc_html__( 'Single Post Options', 'aster-startup' ), 'panel' => 'aster_startup_theme_options', ) ); // Post Options - Show / Hide Date. $wp_customize->add_setting( 'aster_startup_single_post_hide_date', array( 'default' => true, 'sanitize_callback' => 'aster_startup_sanitize_switch', ) ); $wp_customize->add_control( new Aster_Startup_Toggle_Switch_Custom_Control( $wp_customize, 'aster_startup_single_post_hide_date', array( 'label' => esc_html__( 'Show / Hide Date', 'aster-startup' ), 'section' => 'aster_startup_single_post_options', ) ) ); // Post Options - Show / Hide Author. $wp_customize->add_setting( 'aster_startup_single_post_hide_author', array( 'default' => true, 'sanitize_callback' => 'aster_startup_sanitize_switch', ) ); $wp_customize->add_control( new Aster_Startup_Toggle_Switch_Custom_Control( $wp_customize, 'aster_startup_single_post_hide_author', array( 'label' => esc_html__( 'Show / Hide Author', 'aster-startup' ), 'section' => 'aster_startup_single_post_options', ) ) ); // Post Options - Show / Hide Category. $wp_customize->add_setting( 'aster_startup_single_post_hide_category', array( 'default' => true, 'sanitize_callback' => 'aster_startup_sanitize_switch', ) ); $wp_customize->add_control( new Aster_Startup_Toggle_Switch_Custom_Control( $wp_customize, 'aster_startup_single_post_hide_category', array( 'label' => esc_html__( 'Show / Hide Category', 'aster-startup' ), 'section' => 'aster_startup_single_post_options', ) ) ); // Post Options - Show / Hide Tag. $wp_customize->add_setting( 'aster_startup_post_hide_tags', array( 'default' => true, 'sanitize_callback' => 'aster_startup_sanitize_switch', ) ); $wp_customize->add_control( new Aster_Startup_Toggle_Switch_Custom_Control( $wp_customize, 'aster_startup_post_hide_tags', array( 'label' => esc_html__( 'Show / Hide Tag', 'aster-startup' ), 'section' => 'aster_startup_single_post_options', ) ) ); // Add Separator Custom Control $wp_customize->add_setting( 'aster_startup_related_post_separator', array( 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Aster_Startup_Separator_Custom_Control( $wp_customize, 'aster_startup_related_post_separator', array( 'label' => __( 'Enable / Disable Related Post Section', 'aster-startup' ), 'section' => 'aster_startup_single_post_options', 'settings' => 'aster_startup_related_post_separator', ) ) ); // Post Options - Show / Hide Related Posts. $wp_customize->add_setting( 'aster_startup_post_hide_related_posts', array( 'default' => true, 'sanitize_callback' => 'aster_startup_sanitize_switch', ) ); $wp_customize->add_control( new Aster_Startup_Toggle_Switch_Custom_Control( $wp_customize, 'aster_startup_post_hide_related_posts', array( 'label' => esc_html__( 'Show / Hide Related Posts', 'aster-startup' ), 'section' => 'aster_startup_single_post_options', ) ) ); // Register setting for number of related posts $wp_customize->add_setting( 'aster_startup_related_posts_count', array( 'default' => 3, 'sanitize_callback' => 'absint', // Ensure it's an integer ) ); // Add control for number of related posts $wp_customize->add_control( 'aster_startup_related_posts_count', array( 'type' => 'number', 'label' => esc_html__( 'Number of Related Posts to Display', 'aster-startup' ), 'section' => 'aster_startup_single_post_options', 'input_attrs' => array( 'min' => 1, 'max' => 3, // Adjust maximum based on your preference 'step' => 1, ), ) ); // Post Options - Related Post Label. $wp_customize->add_setting( 'aster_startup_post_related_post_label', array( 'default' => __( 'Related Posts', 'aster-startup' ), 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'aster_startup_post_related_post_label', array( 'label' => esc_html__( 'Related Posts Label', 'aster-startup' ), 'section' => 'aster_startup_single_post_options', 'settings' => 'aster_startup_post_related_post_label', 'type' => 'text', ) );