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

174
Views
Replace Wordpress Menu Based on Customer Location with Cloudflare Worker

I am attempting to swap the Wordpress Menu based on Viewer Location using cloudflare workers. Here is a simple method to do this in functions.php: https://gist.github.com/timersys/1eaa6ed10e2dea0e9a972733acd3ded0

My Goal is to write something similar as such:

    addEventListener('fetch', event => {
        event.passThroughOnException()
        event.respondWith(handleRequest(event.request))
    })
    
    async function handleRequest(request) {
        const country = request.cf.country
        if (country != 'US' && country !='CA') {
    
        CHANGE MENU

}
        // return modified response
         return new Response(html, response) 
    }
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!