4483 posts ThemeForest Senior Reviewer
  • Affiliate Level 1
  • Author Level 6
  • Collector Level 3
  • Envato Team
+14 more
Ivor
Envato team
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
  • 5 Years of Membership
  • Affiliate Level 2
  • Author Level 5
  • Collector Level 2
+8 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
  • 5 Years of Membership
  • Affiliate Level 2
  • Collector Level 2
  • Exclusive Author
+4 more
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
  • 5 Years of Membership
  • Affiliate Level 5
  • Author Level 9
  • Bundle Boss
+8 more
duotive
says

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

4483 posts ThemeForest Senior Reviewer
  • Affiliate Level 1
  • Author Level 6
  • Collector Level 3
  • Envato Team
+14 more
Ivor
Envato team
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)

2337 posts
  • Affiliate Level 5
  • Author Level 6
  • Collector Level 2
  • Trendsetter
+7 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

839 posts
  • Power Elite Author
  • Winner
  • Top Monthly Author
  • Trendsetter
+10 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
  • 5 Years of Membership
  • Affiliate Level 2
  • Author Level 5
  • Collector Level 2
+8 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