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:
- With
$_SERVER['DOCUMENT_ROOT']
- With
dirname(_FILE_)
- With
ABSPATH
// this are define on mywp-config.php
- With
home_url
- With
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:Read more in this related answer.