4391 posts ThemeForest Reviewer
  • Has referred 1+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Member of the Envato Team
+12 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
  • Has been part of the Envato Community for over 4 years
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+6 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
  • Has been part of the Envato Community for over 5 years
  • Has referred 10+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 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
  • Has been part of the Envato Community for over 4 years
  • Has referred 200+ members
  • Has sold $250,000+ on Envato Market
  • Had an item featured in an Envato Bundle
+7 more
duotive says

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

4391 posts ThemeForest Reviewer
  • Has referred 1+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Member of the Envato Team
+12 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)

2333 posts
  • Has referred 100+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Helped several times protecting Envato Market against copyright violations
+5 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

834 posts
  • Power Elite Author: Sold more than $1M on Envato Market
  • Won a competition
  • Made it to the Authors' Hall of Fame
  • Has sold $1M+ on Envato Market and is now a Power Elite Author
+7 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
  • Has been part of the Envato Community for over 4 years
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+6 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 :)

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by