我正在使用此代码转到页面.在我的目录中有主题文件夹ch.
<li>
<a href="<?php echo get_stylesheet_directory_uri(); ?>/ch/bn1.php">
<img src="<?php echo get_stylesheet_directory_uri(); ?>/img/bn1.png">
</a>
</li>
Run Code Online (Sandbox Code Playgroud)
但是转到页面url wp-content/themes/live/ch/bn1.php会显示此消息
致命错误:在第1行的C:\ wamp\www\blog\wp-content\themes\live stream\ch\bn1.php中调用未定义的函数get_header()
我的主题目录是
www/blog/wp-content/themes/live stream
Run Code Online (Sandbox Code Playgroud)
我要转到目录的页面是
www/blog/wp-content/themes/live stream/ch/bn1.php
Run Code Online (Sandbox Code Playgroud)