WordPress Tutorial
Jul 14
WordPress Counter Bar Plugin
Views
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:
There are additional parameters you can pass which include:
- $type = 'comments' This can be comments or views depending on the type of bar you want to display.
- $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.
- $vertical = 0 This with a will display the bar horizontally if 0 is passed, and will display the bar vertically if 1 is passed.
- $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.
- $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'.
- $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.
Clique It
Nice work on this Drix. I really like the way it looks.
July 14th, 2006 at 6:43 pmI’m having trouble with this counter. I have it loaded and activated, but I am not understanding the instructions from that point. I want to place the counter in the right blog column on my WP page. When I create a new page and enter the code in the code tab I get nothing. What am I doing wrong?
if (function_exists(’tipclique_CounterBar’)) {
tipclique_CounterBar();
}
I guess my question is, where does the above code go. I don’t want the counter in a post because it will then disappear when the post is archieved. my email mpm@dc.rr.com
My web site is www.actforamerica92253.org
June 6th, 2008 at 9:44 amPingback
TipClique Counter Bar · WordPress插件中文站Pingback on July 15th, 2006 at 4:17 am
Pingback
BloggingPro China » Blog Archive » WordPress Plugin: Counter BarPingback on July 18th, 2006 at 4:24 am
Pingback
插件 » Blog Archive » TipClique Counter BarPingback on October 13th, 2006 at 5:06 pm
Pingback
WP Plugins DB » Blog Archive » TipClique Counter BarPingback on May 19th, 2007 at 11:53 pm
Pingback
LinXblog » 增加了counterPingback on July 7th, 2007 at 10:50 pm
Pingback
The Apperceive Show » New Progress Meter GraphicsPingback on January 19th, 2008 at 7:05 pm