Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

218
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda