Skip to Content

WordPress Counter Bar Plugin

Submitted by Administrator on August 9, 2010 Website: www.tipclique.com

This tutorial will show you how to install and configure the Counter Bar plugin for WordPress written by TipClique's very own, Drixer.

Installation:

The installation is the same as it is for most WordPress plugins. Extract the zip file to your plugins directory and activate under Plugins in WordPress' control panel.


Usage:

To add a bar to your page you simply call the function like this:

if (function_exists('tipclique_CounterBar')) {
    tipclique_CounterBar();
}

Call it within the loop for the page you want it to show. This will display the default bar, which shows the number of comments your post has had. To show the bar with number of views a post has had call the same function with the type parameter set to 'views':

if (function_exists('tipclique_CounterBar')) {
    tipclique_CounterBar('views');
}

You can add more customization to the bars through the parameters you pass to the function. You can change the color to one of the three colored images supplied by calling the function as normal, and adding the color parameter:

if (function_exists('tipclique_CounterBar')) {
    tipclique_CounterBar('views', 'blue');
}

For testing, you will need to log out of WordPress to count your own views.

Examples:

Examples

There are additional parameters you can pass which include:

  1. $type = 'comments'
    This can be comments or views depending on the type of bar you want to display.
  2. $barColor = 'yellow'
    There are three options included, yellow, blue, and green. You can use your own color by passing the colors hex value i.e. #ff0000.
  3. $vertical = 0
    This with a will display the bar horizontally if 0 is passed, and will display the bar vertically if 1 is passed.
  4. $simpleCount = 1
    This can show the count with 1 as the value passed, or with 0 passed it will show the percentage of the max number of views, or comments.
  5. $label = 'Comments'
    This is for the label which displays to the left of horizontal bars, or under vertical bars. If not supplied for comments the default is 'Comments', and for views the default is 'Views'.
  6. $echo = true
    This set as true will echo the result as the function is called, otherwise it will return the result so you can echo it when you choose.

Download Counter Bar

No related posts.

No Responses to “WordPress Counter Bar Plugin” Leave a reply ›

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Spam protection by WP Captcha-Free