I'm trying to include some .php
files in the header.php
of my Wordpress Site.
Here is my schema:
Root/
|_ includes
|_ db_connect.php
|_ functions.php
|_ var_list.php
|_ wp-includes
|_ wp-content
|_ themes
|_ NameTheme
|_ header.php
|_ wp-admin
I need to include this lines on my 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
What I tryed:
$_SERVER['DOCUMENT_ROOT']
dirname(_FILE_)
ABSPATH
// this are define on my wp-config.php
home_url
site_url
All return blank page (500 internal error) Can help me, please? Thanks.
If you have a standard wp-config.php file, ABSPATH
should be defined. This means you should be able to use:
include_once(ABSPATH . 'includes/db_connect.php');
Read more in this related answer.