Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

216
Views
Why is this validation code in the head tag totally ignored once uploaded to the site? It always executes the script inside

I have this code in the head tag of the site and I want to execute only in the production site. It works locally but it is totally ignored once placed in the site, meaning the script is always executed. There are other pieces of code working with php in the head tag validating scripts and they work fine but this one doesnt do anything to make the script not execute in a development site. I must mention the head tag doesnt have or use any other get_site_url() in it. That function works fine anywhere in the site but this is my first time using it in the head tag. Is there any other way I could do this and make it work?? My code is the following:

 <head>
     <?php if (get_site_url() === "https://www.testwebsite.com") : ?>
    
        <script src="https://global.localizecdn.com/localize.js"></script>
        <script>
    
            !function (a) {
                if (!a.Localize) {
                    a.Localize = {};
                    for (var e = ["translate", "untranslate", "phrase", "initialize", "translatePage", "setLanguage", "getLanguage", "getSourceLanguage", "detectLanguage", "getAvailableLanguages", "untranslatePage", "bootstrap", "prefetch", "on", "off", "hideWidget", "showWidget"], t = 0; t < e.length; t++) a.Localize[e[t]] = function () {
                    }
                }
            }(window);
        </script>
    
        <script>
            Localize.initialize({
                key: '12c7ba123a6af',
                rememberLanguage: true
            });
        </script>
    
    <?php endif; ?>
    <?php wp_head(); ?>
</head>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!