Tool for displaying/hiding custom content based on visitors country/location.
Currently there are 4 options/parameters: country, show, message, html
country: a comma-separated list of country codes, e.g. country="us, es, uk"
show: is a simple yes ('y') or no ('n'). e.g. to hide content, show="n"
message: is an optional piece of text you can display when the content that you're showing/hiding from a group of people isn't shown. Instead of displaying absolutely nothing, you can display a message. e.g message="Sorry, this content isn't available in your region."
html: This is the html tag within which the content will be wrapped, e.g. DIV, SPAN, ... If this isn't specified, SPAN is used. If you don't want any HTML wrapping specify html="none"
To show the text "abcdefg" ONLY to visitors from the US and France, I would use the following shortcode:
[CBC country="us, fr" show="y"]abcdefg[/CBC]
To then hide the text "mnopqrst" ONLY from visitors in Spain, I would use the following shortcode:
[CBC country="es" show="n"]mnopqrst[/CBC]
Then 'show' will default to 'y' and proceed accordingly.
Nothing, it will just print the content to everyone.
If your site isn't using CloudFlare, you really should consider it.
Separately, if you are using it on your site, you have a slight optimization where I use a parameter that CloudFlare sends that gives the users location saving me an SQL query.
The plugin makes use of the location data provided by IP 2 Nation that is freely available. You don't need to pay for this.
No. The plugin, upon activation, will ask you to install the necessary data into your own WordPress database. If you don't install this data, you cannot use the plugin.
I believe the country codes are ISO 3166 country codes. You can find a list here: http://en.wikipedia.org/wiki/ISO_3166-1
Yes, I have provided 2 extra shortcodes. They are:
[CBC_COUNTRY /] takes no parameters and is used as-is. This will print the visitor's full country name.
[CBC_IP /] takes no parameters and is used as-is. This will print the visitor's full IP address (or their proxy server).
Yes. I'm still baffled why other plugin authors find this a challenge.
Yes. Again, I'm still baffled why other plugin authors find this a challenge.
Any output from the plugin is wrapped in html SPANs with corresponding classes:
CBC has class 'cbc_content' CBC_COUNTRY has class 'cbc_country' CBC_IP has class 'cbc_ip'
There is also the option within the each shortcode itself to specify ID and STYLE just like you would HTML elements.
e.g. [CBC country="gb" show="y" id="my_cbc_id" style="color:yellow;"]Custom Content for GB[/CBC]
W3 Total Cache allows you to (programmatically) set caching options on a per-page basis. This means we can say for any WordPress page/post that is loaded, to allow caching, or not.
As of version 2.11, I have added the global plugin option to turn off page caching for ONLY those pages that use this shortcode. If you use this shortcode throughout your website using your theme, and you enable this option, you will effectively turn off page caching for your entire site.
Remember this only affects page caching. It doesn't affect any browser caching, database or object caching etc. If you don't know what this means, read the FAQ on the W3 Total Cache plugin for more info.
We also created the Manage Multiple WordPress Site Better Tool: iControlWP for people with multiple WordPress sites to manage.
Yes, we created the only Twitter Bootstrap WordPress plugin with over 122,000 downloads so far.
If your local network address is defined as "Private" according to the database, the country code to use in this case is: 01
This isn't fully tested and shouldn't be used as-is in production but it seems to hold up. Feedback welcome.
Currently, no (but eventually, yes). You can do so manually by firing up your phpMyAdmin for your site and dropping the following 2 tables:
Requires: 3.2.0 or higher
Compatible up to: 4.7.1
Last Updated: 2 months ago
Active Installs: 2,000+
0 of 6 support threads in the last two months have been marked resolved.
Got something to say? Need help?