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.phphome_urlsite_urlAll 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With