• Resolved Gottano

    (@gottano)


    Hello

    I was wondering how I can hide or show a page according to where a person is, in terms of city. Could this be done in CSS?

    Specifically, I would like to show a page to people in S?o Paulo. Ideally this page would show in the menu as well.

    If the user is outside S?o Paulo then he/she doesn’t get to see this page.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Benjamin Pick

    (@benjamin4)

    Yes this is possible to do in CSS.
    In the menu, you can give the page a custom css class, and then add display:none …
    The page is more difficult, you could hide the content for other cities and show a text like “Sorry, this content is not available at your location.”

    However, always keep in mind that geolocation is never 100% accurate. So is there a way for the visitors to say “but I am in Sao Paolo!” ? You could let the page be visible and add a hightlighted box for non-sao paolo visitors, or hide the content of the page but on click, make it visible again.

    Plugin Author Benjamin Pick

    (@benjamin4)

    Oh I am not sure if the city can be used in CSS, I could add it to the body classes …

    • This reply was modified 2 years, 2 months ago by Benjamin Pick.
    Plugin Author Benjamin Pick

    (@benjamin4)

    This is available in Version 5.1.1-beta1
    See https://github.com/yellowtree/geoip-detect/wiki/Beta-Testing

    Thread Starter Gottano

    (@gottano)

    Thank you. I shall take a look.

    All the best.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Hide/show a page according to city’ is closed to new replies.