Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Location Based Content

Posted on 2015-02-11
7
Medium Priority
?
100 Views
Last Modified: 2015-02-11
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.
0
Comment
Question by:oo7ml
  • 4
  • 3
7 Comments
 
LVL 17

Accepted Solution

by:
Chris Millard earned 2000 total points
ID: 40603047
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
 

Author Comment

by:oo7ml
ID: 40603074
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
 
LVL 17

Expert Comment

by:Chris Millard
ID: 40603125
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:oo7ml
ID: 40603166
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
 
LVL 17

Expert Comment

by:Chris Millard
ID: 40603173
[wpgc_is_not_country_name" country_name="United Kingdom, United States, Ireland, Australia"]
0
 
LVL 17

Expert Comment

by:Chris Millard
ID: 40603187
or you can do it based on country codes:-

[wpgc_is_not_country_codes" country_codes="US,GB,AU,IE"]
0
 

Author Closing Comment

by:oo7ml
ID: 40603194
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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
Suggested Courses
Course of the Month6 days, 10 hours left to enroll

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question