Home>Support>Use of undefined constant REQUEST_URI – Vantage theme

Use of undefined constant REQUEST_URI – Vantage theme

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

I use Vantage theme in my wordpress.

Recently, I set my WP_DEBUG ‘true’ and I entered my ‘URL/wp-admin’.

I found the below message in the above log-in screen.

Notice: Use of undefined constant REQUEST_URI – assumed ‘REQUEST_URI’ in /razorbladesmile/www/wp-content/themes/vantage-child/functions.php on line 73

Line 73 is below code.

$path = $_SERVER[‘HTTP_HOST’] . $_SERVER[REQUEST_URI];

How can I remove the above Notice except setting WP_DEBUG false?

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 7 years, 5 months ago Andrew Misplon
    Hi, I Work Here

    Hi hslee

    Thanks for posting.

    The undefined constant is in your child theme so the management of that line of code would be up to you. You’d need to look at the variable, see what you’ve added it for and diagnose the issue from there. If you don’t need the variable `$path` you can delete it but you’d need to look at your child theme code and diagnose what’s happening there.

  2. 7 years, 5 months ago Andrew Misplon
    Hi, I Work Here

    (Debug should be set to false when not troubleshooting a problem. false is the correct value for a production website.)

  3. 7 years, 5 months ago hslee

    Thanks for you answer, Andrew.

    But the code was in functions.php of original Vantage theme.

    $path = $_SERVER[‘HTTP_HOST’] . $_SERVER[REQUEST_URI];

    I made functions.php in my child theme with copying the content of functions.php in original Vantage theme and appending my own codes.

    So, I guess that ‘Notice: Use of undefined constant REQUEST_URI’ will be shown in case of using original Vantage theme.

    In the case of using original Vantage theme, is it ok to delete the above code to remove ‘Notice’?

  4. 7 years, 5 months ago hslee

    Thanks for you answer, Andrew -> Thanks for your answer, Andrew

    (I cannot find how to edit my post.)

    One more thing I want to add is appended codes in functions.php of my child theme do not use the variable `$path`.

  5. 7 years, 5 months ago Andrew Misplon
    Hi, I Work Here

    Thanks for the update and for explaining :) Sorry, no way to edit comments at the moment, apologies for the hassle.

    Ideally, your child theme functions file shouldn’t be a copy of the parent functions file. Only the functions you require should be there.

    Here is the Vantage functions file: https://github.com/siteorigin/vantage/blob/develop/functions.php. I’m not seeing the line you’ve mentioned.

    Once you’ve setup your child theme (https://github.com/siteorigin/vantage-child/blob/develop/functions.php) then ideally you only want to have the functions you specifically require.

    Hope this helps.

  6. 7 years, 4 months ago hslee

    I did as you said.

    And it worked perfect.

    Thanks a lot.

  7. 7 years, 4 months ago Andrew Misplon
    Hi, I Work Here

    Super :) Glad to hear you made progress. All the best with your site.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More