Means.Us.Com

Website DIY - tricks and solutions

CCA Plugin how to guide:

Welcome visitor from ; work smarter by installing the easy to use CCA Plugin:

In this section:

1. CCA Demo (Part 2 how)
2. Initial site-wide settings. DO THIS FIRST
3. Sidebar widgets
    2a. RSS News Feed content
4. Adverts within posts
5. Making widgets smart responsive
6. Customising Posts (Country Aware Shortcodes)

If you are using Cloudflare as a CDN, you can also offload the GeoLocation work to it:
7. See the instructions on Cloudflare’s site.

For coders and developers:

8. Configuring the CCA plugin to use another GeoIP system installed on your site: See CCA and GeoLocation
9. Use CCA plugin hooks to add more functionality: See CCA Extensions


1. CCA Demo (Part 2 how)


2. Initial Site setup DO THIS FIRST

If you want to enable the “Country” functionality of the plugin: from your Dashboard go to “Settings->Category Country Aware Goodies” and under the General Tab check the “Initialize GeoIP” tick box, then click the “Activate” button at the bottom of the form.

Fig 1: CCA Widget Settings Form  (Dashboard->Settings->Catagory Country Aware Goodies)

This step has been added because plugins listed & stored in the WordPress.Org Plugins Directory must be licensed under GPL and this is now being enforced by the WordPress team. The data file to identify the visitor’s country is provided by Maxmind under a Creative Commons license; the WordPress team instructions are that Maxmind data should be installed by the plugin when you (the user) requests it.


3. CCA “Sidebar” widget

Fig 1: CCA Widget Settings Form  (Note: RSS functinallity is hidden)

You can use multiple CCA widgets each with their own content. The widget has the same settings as the standard WordPress Text or RSS widgets; additionally:

  • It has fields for category and visitor country enabling you to provide different content for different posts and visitors. (Fig 1 above)
  • You can use the HTML <br> tag in CCA widget titles. (Fig 1)
  • You can specify the number of characters to display for “RSS” news feed items. (Fig 3 below)
  • Option to “nofollow” news feed links (SEO benefits) and set links to open in new tabs. (Fig 3)

Note: you must always start off by adding an entry for category “all” / country “any”; this is the default content displayed when there isn’t a more specific and suitable entry to display. If you only want a widget displayed for specific category(s)/country(s) then you can set this default entry to a widget type to “None”.


3a. Adding RSS “functionality” to widgets


The majority of users do not need the RSS option so it is “hidden” by default. To add this functionality to your widgets you need to check the RSS option on the plugins global settings (Dashboard-> Settings-> Category Country Aware Goodies).

Fig 2: CCA plugin site wide settings

CCA widgets will then include an option to allow you to select widget type of Text or RSS for each Category/Country entry (Fig 3 below)

Fig 3: CCA widget with RSS settings

Note: Like the WordPress RSS widget; if you don’t provide a widget title the News Feed provider’s title is displayed for the RSS content.

The CCA widget has the same options as the standard WP RSS widget. Additionally: it allows you to specify the size of the news items summary; and to open RSS links in a new tab and “nofllow” the links (good for SEO).


4. Ads within Posts widget


Dashboard-> Settings-> Category Country Aware Goodies -> “Ads within Posts widget”

Fig 4: Adds within Posts widget

See next section, if you want the content to be displayed on small devices like smartphones ONLY.


5. Making widgets smart responsive


Dashboard-> Settings-> Category Country Aware Goodies -> General

1. Check the “display Responsive option in widgets” checkbox; and save settings (Fig 5 below). The screen will refresh and the settings form will now include a field where you can enter the smart responsive trigger width.

2. Enter the width (Fig 5) at which:

  • your sidebar is moved or hidden (responsive themes); or
  • you have to scroll right in your browser to see the sidebar (fixed width/fluid themes)

and save settings.

Example :If you shrink your browser window on this site you will see the theme hides the sidebar when your browser width is <= 800 pixels. So I've set the CCA Responsive pixel width trigger at 800px.

Fig 5:Sitewide CCA Smart Responsive settings
 

3. Your CCA widgets (both sidebar and “in posts”) will now include a smart responsive checkbox. Check this box and save settings on any widget you wish to be smart responsive

Fig 6: “Ads within posts” with smart responsive checkbox
 


6. Country Aware Shortcodes


Examples:

actual text in post visitor from YOUR country sees:
15% discount for visitors from [cca_countryname] 15% discount for visitors from United States
[cca_countrycode] <img src=”yourImages/yourFlags/[cca_countrycode].png” /> US
[cca_convert C=-2] is cold 28°F is cold
[cca_convert F=105.5] is hot 105.5°F is hot
[cca_display only=US,GB,IN]THIS PARAGRAPH IS ONLY DISPLAYED TO VISITORS FROM USA, UK, & INDIA[/cca_display]
Some information for everyone… …
THIS PARAGRAPH IS ONLY DISPLAYED TO VISITORS FROM USA, UK, & INDIA

Some information for everyone…

United States….

[cca_display not=US]Some info for non-residents…[/cca_display]
Some information for everyone… …
United States….

Some information for everyone…

The Baltic States ….

[cca_display not=LV,LT]Some info for non-residents… … …[/cca_display]
Some info for everyone…
The Baltic States ….

Some info for non-residents…


Some info for everyone…

Notes:

  1. Parameters/values are case insensitive e.g. noT=gb,US,ca, c=-2, CaSe=lOwEr would work.
  2. Converted temperatures are rounded to the nearest degree.

[cca_countryname]: inserts the name of the visitor’s Country

[cca_countrycode]: inserts the visitor’s ISO Country code
[cca_countrycode case=”lower”]: as above but converted to lowercase

[cca_convert C=n] or [cca_convert F=n] (where “n” is the number of degrees in Celsius or Fahrenheit): Displays the specified temperature in the scale used by your visitor. See examples above.

[cca_display not=aa,aa]Some section or paragraph…[/cca_display] (where “aa,aa” is one or more comma separated country codes): The content between the [cca_display] tags is hidden from visitors whose countries are defined by the “not=” parameter.

2 Comments

  1. Why on earth would you include a NOT filter shortcode to hide information from selected countries but not a positive filter to only show information to certain countries? That is nonsensical and I can only assume it is deliberate for some reason?

    • AW
      AW

      April 10, 2015 at 8:34 am

      Update: the option you wanted was already in the free add-on however I’ve now added it to the core CCA plugin.

      Hi Jeremy

      1. An ONLY filter (i.e display only for these countries) for the shortcode is available via a free extension (see the CCA Extensions page).

      2. When I get time I will move this option to to the core plugin (along with the sidebar widget option “to not display by default, or for selected category/country option)

      3. As with many plugin authors the plugin was a result of things I initially needed myself e.g. display NOT. The plugin has been designed to enable users to add there own extensions, and it was easier for me initially to quickly add the “display only” shortcode to the extension. Providing useful features via the extension also serves to highlight to users that they can use the plugins extensions capability to write their own useful add-ons to the CCA plugin.

      Hope this helps

Leave a Reply

Your comment will appear after its approved; usually within 12 hours but can be up to a week.
Your email address is optional and will not be published.

Copyright © 2014-2017  Means.Us.Com
This site recommends and is hosted by: Kualo Web Hosting.    
Theme: hemingway
 

Blog home  |  ↑ Top of Page ↑