【发布时间】:2015-10-26 08:25:22
【问题描述】:
谁能告诉我为什么...
我正在使用子主题,我想添加一个新的 php 文件 test.php。
我把这个放在functions.php中
//Gives correct file and path to the child-theme
echo get_bloginfo('stylesheet_directory') . "/test.php";
//gives me a blank page (error).
require_once( get_bloginfo('stylesheet_directory') . "/test.php" );
//require( get_bloginfo('stylesheet_directory') . "/test.php" ); also throws an error
为什么实际包含会报错?
同时
//works perfectly
include( get_bloginfo('stylesheet_directory') . "/test.php" );
有效吗?
【问题讨论】: