我想为我的wordpress主题创建自定义选项主题页面,并且找到了本教程http://wp.tutsplus.com/tutorials/theme-development/create-a-settings-page-for-your-wordpress-theme/,但问题是它不起作用,而且我担心这太过时了。我正在使用wordpress 3.7.1。我添加并尝试创建wordpress设置主题页面的功能是
function setup_theme_admin_menus() {
add_submenu_page('themes.php',
'Front Page Elements', 'Front Page', 'manage_options',
'front-page-elements', 'theme_front_page_settings');
}
function theme_front_page_settings() {
echo "Hello, world!";
}
我将其放置在主题functions.php中,但没有任何反应。
添加此代码:add_action(“ admin_menu”,“ setup_theme_admin_menus”);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句