How can i adapt the following code to show my custom “Theme Settings” page under “appearence” and NOT under “settings” in the wordpress backend?
add_action('admin_menu', 'theme_options_page'); function theme_options_page() { add_options_page('Theme Settings', 'Theme Settings', 'administrator', __FILE__, 'build_options_page');
Here you can find the full code snippet
using add_submenu_page
add_submenu_page( themes.php, 'Title of Page', 'Theme Options', 'manage_options', 'custom_options', 'custom_function' );
function custom_function()
{
// add your form code here or include a file here
}
for under Appearance use themes.php
as parent_slug
or you can also use
using add_theme_page
add_theme_page( 'this is page Title', 'Theme Options', 'manage_options', 'custom_options', 'custom_function' );
for more info please check you can check
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.