我如何适应以下代码显示我的自定义"主题设置"页面下的"外观",而不是在wordpress后端"设置" ?
add_action('admin_menu', 'theme_options_page'); function theme_options_page() { add_options_page('Theme Settings', 'Theme Settings', 'administrator', __FILE__, 'build_options_page');
在这里您可以找到完整的代码片段
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
}
外观下用themes.php
代替parent_slug
或者也可以用
使用add_theme_page
add_theme_page( 'this is page Title', 'Theme Options', 'manage_options', 'custom_options', 'custom_function' );
更多信息请查看你可以检查