主题:功能。php
function one_admin_menu() {
add_menu_page(
\'One Dashboard\',
\'One\',
\'manage_options\',
\'one_menu\',
\'one_menu_url\',
\'dashicons-admin-site\',
1
);
}
add_action( \'admin_menu\', \'one_admin_menu\' );
function one_menu_url() {
include( get_template_directory() . \'/includes/admin/main_one/main.php\' );
}
主要。php
<?php
function one_admin_website() {
$web = get_template_directory_uri() . \'/includes/admin/main_one/website.php\';
echo $web;
}
?>
<script>
function import_admin_menu(when, where, what) {
jQuery(document).ready(function() {
jQuery(when).click(function() {
jQuery(where).load(what);
});
});
}
</script>
<ul>
<li id=\'website\'><a href="#about">Website</a></li>
</u>
<script>
import_admin_menu(\'#website\', \'#one_main_admin\', \'<?php one_admin_website() ?>\' )
</script>
<div id=\'one_main_admin\'> </div>
网站。php
我的问题就在这里,只是尝试回显模板目录,我遇到了致命错误:未捕获错误:调用未定义的函数get\\u template\\u directory\\u uri()
<?php echo get_template_directory_uri(); ?>
我做错了什么?我试着在stackoverlow的谷歌上搜索,但没有找到任何东西。谢谢你抽出时间