Php 文件未包含在wordpress标题中
我想在该目录的头文件中包含一个文件: wp content/themes/themename/header.php 我用于包含的代码是:Php 文件未包含在wordpress标题中,php,include,include-path,file-inclusion,Php,Include,Include Path,File Inclusion,我想在该目录的头文件中包含一个文件: wp content/themes/themename/header.php 我用于包含的代码是: include("../../plugins/booking/informationform.php"); 当我要包含的文件在此目录中时: wp content/plugins/booking/informationform.php 这给了我一个类似这样的错误: 警告:include(../../plugins/booking/informationform
include("../../plugins/booking/informationform.php");
当我要包含的文件在此目录中时:
wp content/plugins/booking/informationform.php
这给了我一个类似这样的错误:
警告:include(../../plugins/booking/informationform.php)[function.include]:无法打开流:没有这样的文件或目录
在里面
/home/zapptv/domains/tvworkshop.com/public_html/wp-content/themes/tvworkshop/header.php
在线100
警告:包括(../../plugins/booking/informationform.php)
[函数.include]:无法打开流:没有这样的文件或目录
在里面
/home/zapptv/domains/tvworkshop.com/public_html/wp-content/themes/tvworkshop/header.php
在线100
警告:include()[function.include]:打开失败
“../../plugins/booking/informationform.php”以供包含
(包括_path='。:/usr/local/lib/php')
/home/zapptv/domains/tvworkshop.com/public_html/wp-content/themes/tvworkshop/header.php
在线100
但是,当我将文件复制到头所在的同一目录中并仅包含文件名时,它不会给出任何错误并成功包含 为什么需要相对路径?Wordpress中有一些函数可用于确定正确的路径,它将负责确定文件的位置。请简要回答如何处理该文件,我的目标是包括该文件,无论以何种方式:)给您: