Location Based Content

Hi, i am in the process of updating a client's website.

They have 4 different company Facebook accounts / pages:

UK
Ireland
US
Australia

They have a Facebook icon / link in the header of their website, and they want to change the link based on where they user is viewing their website from. If the user is based in the US, display the US Facebook Page link etc...

Their site is wordpress based. Can anyone recommend a way of accomplishing the above? Thanks in advance for your help.
oo7mlAsked:
Who is Participating?
 
Chris MillardCommented:
It looks like you could use the WP GeoCode plugin. Have a look at this article:-

http://premium.wpmudev.org/blog/daily-tip-how-to-display-wordpress-posts-based-on-a-users-geolocation/
0
 
oo7mlAuthor Commented:
Cool, i've just looked at that, but can't seem to find a way how you could adjust the following line for each of the 3 countries:


<a href="https"//facebook.com/page">Go To Facebook</a>
0
 
Chris MillardCommented:
Take a look at https://wordpress.org/plugins/wpgeocode/ - it looks like you could use the Shortcodes to do what you want.

e.g.:-

[wpgc_is_country_name" country_name="United Kingdom"] <a href="https"//facebook.com/UKpage">Go To Facebook</a>[/wpgc_is_country_name]
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
oo7mlAuthor Commented:
Ah cool, thanks Chris... one final question :-)

What if the user is not from any of those questions, how do i use a catch all outside of those 4 listed countries?
0
 
Chris MillardCommented:
[wpgc_is_not_country_name" country_name="United Kingdom, United States, Ireland, Australia"]
0
 
Chris MillardCommented:
or you can do it based on country codes:-

[wpgc_is_not_country_codes" country_codes="US,GB,AU,IE"]
0
 
oo7mlAuthor Commented:
Thanks Chris, i presume their IP registry us updated on a regular basis as i understand that IP database lose their accuracy every few weeks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.