4317 posts ThemeForest Reviewer
  • Envato Staff
  • Reviewer
  • Community Moderator
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Venezuela
  • Has been a member for 5-6 years
  • Envato Studio (Microlancer) Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
+9 more
Ivor Reviewer says
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 :D

Well guys I followed your suggestions and I used this (this snippet search for the wp-load.php) and I got no errors but there’s no email in my inbox yet! i wanna screaaaam :mad: hahaha!

<?php $wp_load_include = "../wp-load.php";
    $i = 0;
        while (!file_exists($wp_include) && $i++ < 10) {
    $wp_load_include = "../$wp_include";
}
require($wp_load_include);
    define("WEBMASTER_EMAIL", "echo get_option('ivor_contact_email')" );
?>
1012 posts
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
  • Egypt
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
+1 more
wizylabs says
<?php $wp_load_include = "../wp-load.php";
    $i = 0;
        while (!file_exists($wp_include) && $i++ < 10) {
    $wp_load_include = "../$wp_include";
}
require($wp_load_include);
    define("WEBMASTER_EMAIL", "echo get_option('ivor_contact_email')" );
?>

Thats nice snipped, ill use that if you dont mind :D.

try echo out the get_option(‘ivor_contact_email’) at the top of the contact-form.php page and see what comes up, disable any ajax processing if you are using any so the form sends you to contact-form.php page

629 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • United States
VagrantRadio says

If I’m thinking correctly, you don’t want to display the option, you want to use it as a definition. Get rid of the “echo”.

3007 posts
  • Author had a File in an Envato Bundle
  • Bought between 1 and 9 items
  • Elite Author
  • Europe
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 100 and 199 users
+2 more
duotive says

$mail = get_option(‘ivor_contact_email’); define(“WEBMASTER_EMAIL”, $mail);

4317 posts ThemeForest Reviewer
  • Envato Staff
  • Reviewer
  • Community Moderator
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Venezuela
  • Has been a member for 5-6 years
  • Envato Studio (Microlancer) Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
+9 more
Ivor Reviewer says

Alright guys after some coffee, some google, some rest and your help it worked :) I never tried to load an external file so this was kind of new for me.

BTW @Mark you can wrap the variable $to with or without quotes it will work anyway :)

<?php require_once( '../../../../wp-load.php' );
    $to = get_option('ivor_contact_email');
    define("WEBMASTER_EMAIL", $to );
?>

Thanks a bunch guys you ROCK ! 8)

2322 posts
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
  • Europe
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 100 and 199 users
+1 more
CreativeMilk says
Alright guys after some coffee, some google, some rest and your help it worked :) I never tried to load an external file so this was kind of new for me.

BTW @Mark you can wrap the variable $to with or without quotes it will work anyway :)

<?php require_once( '../../../../wp-load.php' );
    $to = get_option('ivor_contact_email');
    define("WEBMASTER_EMAIL", $to );
?>
Thanks a bunch guys you ROCK ! 8)

did you forgot the load the load.php? lol

Yes that’s possible, i know

822 posts
  • Power Elite Author: Sold between 1 000 000 - 1 999 999 dollars
  • Power Elite Author
  • Won a Competition
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Europe
  • Bought between 50 and 99 items
+2 more
wpbakery says
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 :D

Right, I think relative path is better

1012 posts
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
  • Egypt
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
+1 more
wizylabs says
Alright guys after some coffee, some google, some rest and your help it worked :) I never tried to load an external file so this was kind of new for me.

BTW @Mark you can wrap the variable $to with or without quotes it will work anyway :)

<?php require_once( '../../../../wp-load.php' );
    $to = get_option('ivor_contact_email');
    define("WEBMASTER_EMAIL", $to );
?>
Thanks a bunch guys you ROCK ! 8)

Glad it worked now :)

by
by
by
by
by
by