5 deleted 2821 characters in body
source | link

As requested here is the entire code →

    <?php

/* ---------------------------------------------- */
/* 1. Adding Theme Options Menu */
/* ---------------------------------------------- */

function klogeto_themeo_options_menu() {

    // Introduces a new top-level menu page
    add_menu_page(
        'Theme Options',                  // The text to be displayed in the browser title bar
        'Theme Options',                  // The text to be used for the menu
        'manage_options',                 // The required capability of users to access this menu
        'klogeto-theme-options',              // The slug by which this menu item is accessible
        'klogeto_initialize_theme_options'      // The name of the function used to display the page content
    );

} // End of klogeto_themeo_options_menu

add_action( 'admin_menu', 'klogeto_themeo_options_menu' );

/* ---------------------------------------------- */
/* 2. Sections, Settings, and Fields */
/* ---------------------------------------------- */

function klogeto_initialize_theme_options() {
    // Let's introduce a section for the header options
    add_settings_section(
        'header_section',                           // The ID to use for this section in attribute tags
        'Header Options',                           // The title of the section rendered to the screen
        'klogeto_logo_display',                     // The function used to render the options for this section
        'klogeto-theme-header-options'              // The ID of the page on which this section is rendered
    );

    add_settings_field(
    'display_logo',                              // The ID (or the name) of the field
    'Upload a logo',                             // The text used to label the field
    'klogeto_logo_display_field',                // The callback function used to render the field
    'klogeto-theme-header-logo-options',         // The page on which we'll be rendering this field
    'header_section'                             // The section to which we're adding the setting
    );

    // Register the settings for the header section
    register_setting(
        'header_section',                   // The name of the group of settings
        'header_options',                   // The name of the actual option (or setting)
        'klogeto_sanitize_header_options'       // The callback to footer sanitization option
    );
}

add_action( 'admin_init', 'klogeto_initialize_theme_options' );



/* ---------------------------------------------- */
/* 3. Call Backs & Functions */
/* ---------------------------------------------- */
function klogeto_logo_display () {

}

function klogeto_logo_display_field () {

}

?>

As requested here is the entire code →

    <?php

/* ---------------------------------------------- */
/* 1. Adding Theme Options Menu */
/* ---------------------------------------------- */

function klogeto_themeo_options_menu() {

    // Introduces a new top-level menu page
    add_menu_page(
        'Theme Options',                  // The text to be displayed in the browser title bar
        'Theme Options',                  // The text to be used for the menu
        'manage_options',                 // The required capability of users to access this menu
        'klogeto-theme-options',              // The slug by which this menu item is accessible
        'klogeto_initialize_theme_options'      // The name of the function used to display the page content
    );

} // End of klogeto_themeo_options_menu

add_action( 'admin_menu', 'klogeto_themeo_options_menu' );

/* ---------------------------------------------- */
/* 2. Sections, Settings, and Fields */
/* ---------------------------------------------- */

function klogeto_initialize_theme_options() {
    // Let's introduce a section for the header options
    add_settings_section(
        'header_section',                           // The ID to use for this section in attribute tags
        'Header Options',                           // The title of the section rendered to the screen
        'klogeto_logo_display',                     // The function used to render the options for this section
        'klogeto-theme-header-options'              // The ID of the page on which this section is rendered
    );

    add_settings_field(
    'display_logo',                              // The ID (or the name) of the field
    'Upload a logo',                             // The text used to label the field
    'klogeto_logo_display_field',                // The callback function used to render the field
    'klogeto-theme-header-logo-options',         // The page on which we'll be rendering this field
    'header_section'                             // The section to which we're adding the setting
    );

    // Register the settings for the header section
    register_setting(
        'header_section',                   // The name of the group of settings
        'header_options',                   // The name of the actual option (or setting)
        'klogeto_sanitize_header_options'       // The callback to footer sanitization option
    );
}

add_action( 'admin_init', 'klogeto_initialize_theme_options' );



/* ---------------------------------------------- */
/* 3. Call Backs & Functions */
/* ---------------------------------------------- */
function klogeto_logo_display () {

}

function klogeto_logo_display_field () {

}

?>
4 added 2827 characters in body
source | link

As requested here is the entire code →

    <?php

/* ---------------------------------------------- */
/* 1. Adding Theme Options Menu */
/* ---------------------------------------------- */

function klogeto_themeo_options_menu() {

    // Introduces a new top-level menu page
    add_menu_page(
        'Theme Options',                  // The text to be displayed in the browser title bar
        'Theme Options',                  // The text to be used for the menu
        'manage_options',                 // The required capability of users to access this menu
        'klogeto-theme-options',              // The slug by which this menu item is accessible
        'klogeto_initialize_theme_options'      // The name of the function used to display the page content
    );

} // End of klogeto_themeo_options_menu

add_action( 'admin_menu', 'klogeto_themeo_options_menu' );

/* ---------------------------------------------- */
/* 2. Sections, Settings, and Fields */
/* ---------------------------------------------- */

function klogeto_initialize_theme_options() {
    // Let's introduce a section for the header options
    add_settings_section(
        'header_section',                           // The ID to use for this section in attribute tags
        'Header Options',                           // The title of the section rendered to the screen
        'klogeto_logo_display',                     // The function used to render the options for this section
        'klogeto-theme-header-options'              // The ID of the page on which this section is rendered
    );

    add_settings_field(
    'display_logo',                              // The ID (or the name) of the field
    'Upload a logo',                             // The text used to label the field
    'klogeto_logo_display_field',                // The callback function used to render the field
    'klogeto-theme-header-logo-options',         // The page on which we'll be rendering this field
    'header_section'                             // The section to which we're adding the setting
    );

    // Register the settings for the header section
    register_setting(
        'header_section',                   // The name of the group of settings
        'header_options',                   // The name of the actual option (or setting)
        'klogeto_sanitize_header_options'       // The callback to footer sanitization option
    );
}

add_action( 'admin_init', 'klogeto_initialize_theme_options' );



/* ---------------------------------------------- */
/* 3. Call Backs & Functions */
/* ---------------------------------------------- */
function klogeto_logo_display () {

}

function klogeto_logo_display_field () {

}

?>

As requested here is the entire code →

    <?php

/* ---------------------------------------------- */
/* 1. Adding Theme Options Menu */
/* ---------------------------------------------- */

function klogeto_themeo_options_menu() {

    // Introduces a new top-level menu page
    add_menu_page(
        'Theme Options',                  // The text to be displayed in the browser title bar
        'Theme Options',                  // The text to be used for the menu
        'manage_options',                 // The required capability of users to access this menu
        'klogeto-theme-options',              // The slug by which this menu item is accessible
        'klogeto_initialize_theme_options'      // The name of the function used to display the page content
    );

} // End of klogeto_themeo_options_menu

add_action( 'admin_menu', 'klogeto_themeo_options_menu' );

/* ---------------------------------------------- */
/* 2. Sections, Settings, and Fields */
/* ---------------------------------------------- */

function klogeto_initialize_theme_options() {
    // Let's introduce a section for the header options
    add_settings_section(
        'header_section',                           // The ID to use for this section in attribute tags
        'Header Options',                           // The title of the section rendered to the screen
        'klogeto_logo_display',                     // The function used to render the options for this section
        'klogeto-theme-header-options'              // The ID of the page on which this section is rendered
    );

    add_settings_field(
    'display_logo',                              // The ID (or the name) of the field
    'Upload a logo',                             // The text used to label the field
    'klogeto_logo_display_field',                // The callback function used to render the field
    'klogeto-theme-header-logo-options',         // The page on which we'll be rendering this field
    'header_section'                             // The section to which we're adding the setting
    );

    // Register the settings for the header section
    register_setting(
        'header_section',                   // The name of the group of settings
        'header_options',                   // The name of the actual option (or setting)
        'klogeto_sanitize_header_options'       // The callback to footer sanitization option
    );
}

add_action( 'admin_init', 'klogeto_initialize_theme_options' );



/* ---------------------------------------------- */
/* 3. Call Backs & Functions */
/* ---------------------------------------------- */
function klogeto_logo_display () {

}

function klogeto_logo_display_field () {

}

?>
3 added 318 characters in body
source | link

Please see the below-mentioned code →

    function klogeto_initialize_theme_options() {
    // Let's introduce a section for the header options
    add_settings_section(
        'header_section',                           // The ID to use for this section in attribute tags
        'Header Options',                           // The title of the section rendered to the screen
        'klogeto_logo_display',                     // The function used to render the options for this section
        'klogeto-theme-header-options'              // The ID of the page on which this section is rendered
    );

    add_settings_field(
    'display_logo',                              // The ID (or the name) of the field
    'Upload a logo',                             // The text used to label the field
    'klogeto_logo_display_field',                // The callback function used to render the field
    'klogeto-theme-header-logo-options',         // The page on which we'll be rendering this field
    'header_section'                             // The section to which we're adding the setting
    );
}

add_action( 'admin_init', 'klogeto_initialize_theme_options' );

But the problem is that the text Header Options is not displaying in the theme options panel.

'Header Options', // The title of the section rendered to the screen

what mistake I am doing? Looks like some silly mistake that I cant diagnose.

I forget to mentioned that I have also written this line of code →

    register_setting(
    'header_section',                   // The name of the group of settings
    'header_options',                   // The name of the actual option (or setting)
    'klogeto_sanitize_header_options'       // The callback to footer sanitization option
);

Please see the below-mentioned code →

    function klogeto_initialize_theme_options() {
    // Let's introduce a section for the header options
    add_settings_section(
        'header_section',                           // The ID to use for this section in attribute tags
        'Header Options',                           // The title of the section rendered to the screen
        'klogeto_logo_display',                     // The function used to render the options for this section
        'klogeto-theme-header-options'              // The ID of the page on which this section is rendered
    );

    add_settings_field(
    'display_logo',                              // The ID (or the name) of the field
    'Upload a logo',                             // The text used to label the field
    'klogeto_logo_display_field',                // The callback function used to render the field
    'klogeto-theme-header-logo-options',         // The page on which we'll be rendering this field
    'header_section'                             // The section to which we're adding the setting
    );
}

add_action( 'admin_init', 'klogeto_initialize_theme_options' );

But the problem is that the text Header Options is not displaying in the theme options panel.

'Header Options', // The title of the section rendered to the screen

what mistake I am doing? Looks like some silly mistake that I cant diagnose.

Please see the below-mentioned code →

    function klogeto_initialize_theme_options() {
    // Let's introduce a section for the header options
    add_settings_section(
        'header_section',                           // The ID to use for this section in attribute tags
        'Header Options',                           // The title of the section rendered to the screen
        'klogeto_logo_display',                     // The function used to render the options for this section
        'klogeto-theme-header-options'              // The ID of the page on which this section is rendered
    );

    add_settings_field(
    'display_logo',                              // The ID (or the name) of the field
    'Upload a logo',                             // The text used to label the field
    'klogeto_logo_display_field',                // The callback function used to render the field
    'klogeto-theme-header-logo-options',         // The page on which we'll be rendering this field
    'header_section'                             // The section to which we're adding the setting
    );
}

add_action( 'admin_init', 'klogeto_initialize_theme_options' );

But the problem is that the text Header Options is not displaying in the theme options panel.

'Header Options', // The title of the section rendered to the screen

what mistake I am doing? Looks like some silly mistake that I cant diagnose.

I forget to mentioned that I have also written this line of code →

    register_setting(
    'header_section',                   // The name of the group of settings
    'header_options',                   // The name of the actual option (or setting)
    'klogeto_sanitize_header_options'       // The callback to footer sanitization option
);
2 formatted the code
source | link
1
source | link