admin管理员组文章数量:1130349
I am trying to add a page to admin panel and following this tutorial here
admin-panel.php
function add_menu_to_wpadmin(){
add_theme_page( 'Admin Contact Us', 'Subscriber list', 'manage_options', 'sublist', 'contactus_admin', 'dashicons-admin-customizer', 110 );
}
add_action('admin_menu', 'add_menu_to_wpadmin');
function contactus_admin(){
echo "contact us";
}
functions.php
require get_template_directory().'/admin_panels/sublist_admin.php';
function static_files(){
wp_enqueue_style('style', get_stylesheet_uri());
}
add_action('wp_enqueue_scripts', 'static_files');
I tried putting the entire code of admin-panel.php inside functions.php but it still didn't work. I also tried changing the position parameter from 110 to 6 (all based on numerous tutorials on the internet).
I am trying to add a page to admin panel and following this tutorial here
admin-panel.php
function add_menu_to_wpadmin(){
add_theme_page( 'Admin Contact Us', 'Subscriber list', 'manage_options', 'sublist', 'contactus_admin', 'dashicons-admin-customizer', 110 );
}
add_action('admin_menu', 'add_menu_to_wpadmin');
function contactus_admin(){
echo "contact us";
}
functions.php
require get_template_directory().'/admin_panels/sublist_admin.php';
function static_files(){
wp_enqueue_style('style', get_stylesheet_uri());
}
add_action('wp_enqueue_scripts', 'static_files');
I tried putting the entire code of admin-panel.php inside functions.php but it still didn't work. I also tried changing the position parameter from 110 to 6 (all based on numerous tutorials on the internet).
本文标签: Unable to add custom page to Wordpress admin panel
版权声明:本文标题:Unable to add custom page to Wordpress admin panel 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749093988a2314963.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论