dtpt75860
2014-07-28 08:14
浏览 79
已采纳

更改wordpress后端中自定义设置页面的位置

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

图片转代码服务由CSDN问答提供 功能建议

我如何调整以下代码以显示“appearence”下的自定义“主题设置”页面,而不是“ 设置“在wordpress后端?

  add_action('admin_menu','theme_options_page');  function theme_options_page(){add_options_page('Theme Settings','Theme Settings','administrator',__ FILE __,'build_options_page'); 
   
 
 

这里你可以找到完整的代码片段

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongshuo1856 2014-07-28 08:18
    已采纳

    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

    点赞 打赏 评论

相关推荐 更多相似问题