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

127
Vistas
How to display different content on the same page using different URLS

I'm using wordpress. I have query string functionally that displays the content in the correct language.

Example urls

example.com/terms/?lang=en
example.com/terms/?lang=es
example.com/terms/?lang=fr
example.com/terms/?lang=db

The code below grabs the query string value[lang code] and the API uses it to show the correct language.

<script type="text/javascript" charset="UTF-8">   
  var langCodeSearch = new URLSearchParams(window.location.search);
  var langCode = Object.fromEntries(langCodeSearch.entries());

              
   Api.Initialized.then(function() {
    Api.LoadContent(["https://url-to-api-that-has-content.json"], langCode.lang //**language declaration need to happen here**);
              });
</script>

The above code works great but would it be possible to have the same functionally but using the following URL structure?

example.com/terms/en
example.com/terms/es
example.com/terms/fr
example.com/terms/gb

I want to display content based on the last part of the URLs.

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