- Author had a Free File of the Month
- Author was Featured
- Bought between 10 and 49 items
- Egypt
- Exclusive Author
- Has been a member for 2-3 years
- Item was Featured
- Referred between 10 and 49 users
- Sold between 10 000 and 50 000 dollars
Ivor, is there anywhere in your theme the option ivor_contact_email is inserted into the database? like somewhere in your theme options that adds the ivor_contact_email option on the form submit ? usingI’m adding the email via the admin panelupdate_option('ivor_contact_email', 'example@example.com');oradd_option('ivor_contact_email', 'example@example.com');![]()
$options[] = array( "name" => "Contact Email", "desc" => "Enter your email for the contact page (i.e. example[at]email.com)", "id" => $shortname."_contact_email", "std" => "", "type" => "text");
I think I caught the problem. The contact-form.php file is reached only by the contact form as its action, therefore you need to include, somehow the wp-load.php from the wp main root without using any of the WordPress paths constants like ABSPATH or whatever in the contact-form.php for the wordpress functions to work.
Hey Ivor,
require($_SERVER['DOCUMENT_ROOT'].'/path/to/wp-load.php' );
If it’s an external file, then you can call get_option(‘your_option’).
require($_SERVER['DOCUMENT_ROOT'].'/path/to/wp-load.php' );
define("WEBMASTER_EMAIL", "get_option('ivor_contact_email')" )
- Author had a Free File of the Month
- Author was Featured
- Bought between 10 and 49 items
- Egypt
- Exclusive Author
- Has been a member for 2-3 years
- Item was Featured
- Referred between 10 and 49 users
- Sold between 10 000 and 50 000 dollars
require($_SERVER['DOCUMENT_ROOT'].'/path/to/wp-load.php' );
define("WEBMASTER_EMAIL", "get_option('ivor_contact_email')" )
Exactly what I meant 
- Envato Staff
- Reviewer
- Community Moderator
- Venezuela
- Has been a member for 4-5 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Microlancer Beta Tester
- Sold between 10 000 and 50 000 dollars
- Exclusive Author
Hey guys thanks a lot, I’m getting there
wizy and vagrant sorry about another silly question but the contact file is inside the includes folder should I use this path? I got an error require($_SERVER['DOCUMENT_ROOT'].'/wp-load.php' );
Exactly what I meantrequire($_SERVER['DOCUMENT_ROOT'].'/path/to/wp-load.php' ); define("WEBMASTER_EMAIL", "get_option('ivor_contact_email')" )![]()

Hey guys thanks a lot, I’m getting therewizy and vagrant sorry about another silly question but the contact file is inside the includes folder should I use this path? I got an error
require($_SERVER['DOCUMENT_ROOT'].'/wp-load.php' );
Its an absolute path, so you want to set the folder to where your wp install is on your server.
- Author had a Free File of the Month
- Author was Featured
- Bought between 10 and 49 items
- Egypt
- Exclusive Author
- Has been a member for 2-3 years
- Item was Featured
- Referred between 10 and 49 users
- Sold between 10 000 and 50 000 dollars
Hey guys thanks a lot, I’m getting therewizy and vagrant sorry about another silly question but the contact file is inside the includes folder should I use this path? I got an error
require($_SERVER['DOCUMENT_ROOT'].'/wp-load.php' );
say you theme includes folder found in wp-content/themes/YourTheme/includes
then use the below. there might be a better way to get the wordpress main root path instead of using tons of ../
require( dirname(__FILE__) . '/../../../../wp-load.php' );
Hey guys thanks a lot, I’m getting therewizy and vagrant sorry about another silly question but the contact file is inside the includes folder should I use this path? I got an error
require($_SERVER['DOCUMENT_ROOT'].'/wp-load.php' );say you theme includes folder found in wp-content/themes/YourTheme/includes
then use the below. there might be a better way to get the wordpress main root path instead of using tons of ../
require( dirname(__FILE__) . '/../../../../wp-load.php' );
Nope, it has to be an absolute path with the code I posted. What you’re doing is trying to get a relative path.
- Author had a Free File of the Month
- Author was Featured
- Bought between 10 and 49 items
- Egypt
- Exclusive Author
- Has been a member for 2-3 years
- Item was Featured
- Referred between 10 and 49 users
- Sold between 10 000 and 50 000 dollars
Nope, it has to be an absolute path with the code I posted. What you’re doing is trying to get a relative path.
But that may cause an issue if wordpress is installed on a sub directory right? not sure though 
