Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Daron Robinson
Daron Robinson
9,055 Points

How can I make a WordPress website change content based on location.

I want to know if there is a plugin or a way to create a plugin that would change the content that shows based on location. I guess an example would be a language switcher that a person would use to select the correct language but instead of choosing a language they would select for instance a country or city and new content would populate based on that category.

1 Answer

There are definitely multiple ways to change the content based on the (client) location. (I guess that is what you are looking for?)

.htaccess, Plugins, PHP Redirect

If you look it up on the internet, you can find different howto-entries (here is one): http://www.ab-weblog.com/en/wordpress-multisite-redirect-users-based-on-their-browser-language/

definitely one good option is to use WPML (the company I am working for has a Wordpress based website with WPML as language plugin): https://wpml.org/documentation/getting-started-guide/language-setup/automatic-redirect-based-on-browser-language/ the downside: WPML is not free.