Apr 01

This plug-in 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… Once tagged (using WordPress’ existing Custom Fields) the plug-in allows flag icons to be added to your blog’s pages with simple additions to your template files. These icons can be clicked on to take the user to a list of posts from that country. There’s also a sidebar widget that creates a popup to navigate to posts from that country too. :cool:

I’m quite pleased with the plug-in, I hope you are too. :oops:

The plug-in is available as a download here.

All I ask is that you credit the plug-in (i.e. include a link to this page or maybe add a link to your WordPress Blogroll).

Because of some demand, please feel free to make a donation here if you find the code valuable!

Thanks!

How to record a country against a post:

    Add a Custom Field to the post with Key = Country and Value set to the name of the country, which must be the same as the name of the flag icon file. Look in wp-content/plugins/country/Flags/ for a list of possible values. For example, to get a UK flag set the Value = UK.

Instructions:

  • Just put the complete plug-in directory into your WordPress plug-in 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.
  • And this <?php country_tag($post->ID, false); ?> in your single.php template file to show the post’s country.
  • Note, you’ll need this <?php gobal $post; ?> declaration in your template files too if not already there.
  • The second parameter (the default true or false) determines if it is a short or long output -
    • Long; Location (Australia)
    • Short;
  • The widget has a single option, a page identifier. When set to the ID of a page a link (World) is shown under the popup list of countries in the widget. Following the link goes to that page - where you might show a list (or map) of countries featured on your blog!
  • You can also include the same popup list of countries used in the widget on your pages with this <?php country_list_countries(); ?>.

Credit to Apple for most of the flags icons.

With great regret comments are closed on this post as I’m being deluged with queries that often boil down to “how to” requests and not issues with the plug-in, which works perfectly! :-) So, if you want support, even advice, use the Feedback link and ask away…

But please note I may have to ask for a donation before I’ll look at “how to” questions…

Version History:

  • 0.2 - Released to the WordPress community.
  • 0.1 - Initial version.
slideshow
Start slideshow with these images
Go to Image Archive...
(Interesting)(Good)(Great)(Fantastic)(Awesome) (Not Rated)
Loading ... Loading ...

Comments are closed.