我试图将一些.php
文件包含在我的Wordpress站点的header.php
中。
下面是我的模式:
Root/
|_ includes
|_ db_connect.php
|_ functions.php
|_ var_list.php
|_ wp-includes
|_ wp-content
|_ themes
|_ NameTheme
|_ header.php
|_ wp-admin
我需要在我的header.php
中包括这一行
include_once 'includes/db_connect.php';
include_once 'includes/functions.php';
include_once 'includes/var_list.php';
sec_session_start(); // function to start session, placed in functions.php
我试过的是:
$_SERVER['DOCUMENT_ROOT']
dirname(_FILE_)
ABSPATH
//在我的wp-config.php
上定义home_url
site_url
请全部返回空白页(500个内部错误)可以帮助我吗?谢谢。
发布于 2015-05-30 11:23:09
如果您有一个标准的wp-config.php文件,那么应该定义ABSPATH
。这意味着您应该能够使用:
include_once(ABSPATH . 'includes/db_connect.php');
在this related answer中阅读更多内容。
https://stackoverflow.com/questions/30545452
复制相似问题