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

119
Views
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
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!