Apr 08 01 |
Country Plugin
This plugin allows you to record a country against your posts. For example the country that the post talks about, the event took place in, the location you are writing the post from, etc. Your imagination is the limit…
Some of the key features are:
- Once a post is tagged with a country the plugin allows flag icons to be added to your blog’s pages with simple additions to your template files.
- Country icons can be clicked to take the user to posts from that country.
- A sidebar widget that provides a popup to navigate to posts from a given country.
- Presents an admin page, under the WordPress Tools menu, to review numbers of posts from each country.
I’m quite pleased with the plugin, so it’s available to share, I hope you enjoy it too.

The plugin is available as a download for free here.
All I ask is that you credit the plugin, for example, include a link to this page or maybe add a link to your WordPress blogroll. Or, perhaps consider purchasing the enhanced version, see below…
Why not check out my other WordPress plugins too!
How to Tag a Post with a Country
Using the In which Country was the Adventure? section of the post writing page. Select the Country you want to tag the post with from the country dropdown. For example, to get a UK flag
select UK from the drop down.
The country names provided are the names of the flag icon files in the directory:
wp-content/plugins/post-country/Flags/Feel free to add additional flag icon files or remove those you don’t want to see listed in the dropdown.
Instructions & Installation
- Just put the complete un-zipped plugin directory into your WordPress plugin directory (if this doesn’t make sense it probably isn’t something you should be trying
) and activate it. - Within the WordPress loop, use this
<?php country_tag($post->ID); ?>in your index.php template file to show a post’s country tag. - And this
<?php country_tag($post->ID, false); ?>in your single.php template file to show the post’s country tag. - Note, you’ll need this
<?php gobal $post; ?>declaration in your template files too if it’s not already there. - The second parameter (the default
true, orfalse) determines if it is a short or long output:- Long – Location
(Australia) - Short –

- Long – Location
- The widget has a single option, a page. When set to one of your pages a link is shown under the popup list of countries in the widget. Following the link goes to that page – where you might show a list of countries featured on your blog, or a map! A map is easily created with the enhanced version of this plugin (see below).
- You can also include the same popup list of countries used in the widget on your pages by adding this
<?php country_list_countries(); ?>to your theme’s template.
Premium Version of the Plugin with Mapping
The standard plugin allows Latitude & Longitude to be stored along with the country tag. Google mapping is available with an enhanced premium version of the plugin available to buy (link below). An example of the mapping is given here.
The enhanced plugin provides two mapping interfaces, one within the WordPress post writing interface to create locations, and a second public map for your blog readers to enjoy.

Using the enhanced mapping feature is easy and highly flexible. Using the mapping is explained in detail here.
Mapping of tagged posts (and Venues, see below) can be presented to your users on a nominated page. (The blog administrator can elect to not display the location of specific posts even when latitude & longitude values have been supplied.) The map display page is nominated on the options page. That page should have the following simple code within its text to show the map.
<!-- adventure-map -->Note, the options page also provides a field to enter the CSS for the map canvas. It is essential that this sets, as a minimum, the size of the canvas. To kick-off try something like:
width: 600px; height: 450px; border: 1px solid #ddd; margin: 5px;
The first two options allow configuration of whether location data, for posts and/or venues, are included in the standards compliant Geo RSS feed generated by the plugin. The location RSS feed is accessed by adding ?feed=venues to your blog’s URL. You may wish to use this, form example, to submit geo content to Google as a geo sitemap.
In addition to tagging posts with country and latitude & longitude for mapping the enhanced plugin provides a special type of post – Venue. These are great for recording specific details about specific locations. For example, a page of information for each country, or a page of details (e.g. pubs, clubs, and hotels) about a particular city. Venues are a blend between standard WordPress pages and posts. Venues are accessed from the new Venues menu. (Note that the list of countries moves with the enhanced version of the plugin from the WordPress Tools menu to the Venues menu.)

Just £9.50
Version History
Enhanced Plugin:
- 4.1 – Trap for a marker in the same place as another.
- 4.0 – Google mapping of posts and venues with location data.
- 3.0 – Venue post-type to record location, beta, facts, links, etc. for given adventure destinations.
Standard Plugin:
- 2.0 – Version without mapping.
- 1.3 – Various lookup widget bug fixes.
- 1.2 – Don’t duplicate meta data.
- 1.1 – New admin summary page.
- 1.0 – Added custom form entry to aid user experience, plus now adds Latitude & Longitude.
- 0.4 – Added custom column to posts management list to show country.
- 0.3 – Fixed bug wih where clause construction; thanks to Thomas Lindholm.
- 0.2 – Released to the WordPress community.
- 0.1 – Initial version.
Thanks!
Article Series - WordPress Plug-ins
- Image Link WordPress Plug-in
- Last Year WordPress Sidebar Widget Plugin
- Simple Archive Plugin
- Avatars Plugin
- WordPress Post Country Plugin
(with premium Google Mapping version) - Notices Ticker Plugin
- Comments with Avatars
- Simple WordPress Twitter Plugin
- WordPress Post Grouping Plugin
Start slideshow with these images








One Response to “WordPress Post Country Plugin

[...] you have my Country plug-in, you can add the country attribute to the tweet. For example, I write blog posts and mark [...]