Solved

Location Based Content

Posted on 2015-02-11
7
73 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 500 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

786 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