Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

219
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda