>
Download This Plugin | |
Download Elegant Themes | |
Name | Likes Counter |
Version | 1.5 |
Author | Gonçalo Neves |
Rating | 100 |
Last updated | 2014-09-07 04:35:00 |
Downloads |
1984
|
Download Plugins Speed Test plugin for Wordpress |
Home page PageSpeed score has been degraded by 0%, while Post page PageSpeed score has been degraded by 0%
Likes Counter plugin added 13 bytes of resources to the Home page and 15 bytes of resources to the sample Post page.
Likes Counter plugin added 0 new host(s) to the Home page and 0 new host(s) to the sample Post page.
Great! Likes Counter plugin ads no tables to your Wordpress blog database.Likes Counter gets Facebook Likes of any page you want and stores the returning value temporarily in database so it doesn't bubble requests to Facebook API.
Benefits:
You can use Likes Counter multiple times in the same code.
After the cache duration expires, it will make a new request and update the Likes value, again for the duration set.
This plugin stores its values with Transients API, so it can be cachable outside database with memcached plugins. I recommend using W3 Total Cache.
Easy to style span tags with css classes likes-counter and likes-counter-separator.
I made this plugin to be as light as possible, so I ended up making a shortcode that gives the user the functionality to build a powerful Facebook Likes Counter.
You can place it anywhere in your post/page with [likescounter page='page_name_or_id'] shortcode.
Example:
SHORTCODE IN POST/PAGE:
[likescounter page='WordPress' duration='30' offset='10' separator='dot' tag='true']
-- Gets 842488 likes from Wordpress Facebook page,
-- Caches the value for 30 minutes,
-- Offsets likes count by 10: 842478,
-- Adds a thousand dot separator: 842.478,
-- Adds a span tag around each character.
Returns : <span class="likes-counter">8</span>
<span class="likes-counter">4</span>
<span class="likes-counter">2</span>
<span class="likes-counter-separator">.</span>
<span class="likes-counter">4</span>
<span class="likes-counter">7</span>
<span class="likes-counter">8</span>
CSS:
Now lets add some CSS inside style.css of your active Theme:
span.likes-counter {
background-color: #eeeeee;
border-bottom: 1px solid #aaaaaa;
border-left: 1px solid #cccccc;
border-radius: 5px;
border-right: 1px solid #dddddd;
border-top: 1px solid #cccccc;
color: #1e8cbe;
margin: 2px;
padding: 5px 10px;
}
span.likes-counter-separator {
color: #dddddd;
padding: 2px 4px;
}
PHP:
If you need to use inside a Theme Template file, use do_shortcode:
<?php echo do_shortcode( '[likescounter page="page_name_or_id"]' ); ?>
<span class="likes-counter">number_character</span>
for number characters and <span class="likes-counter-separator">separator_character</span>
for separators characters.Could not get likes data. Please verify if page is correct.
If you get this there are two possible reasons:
Thank you for you interest in Likes Counter plugin.
If you need help please contact me via Support tab. Feel free to contribute and fork, this plugin is at https://github.com/goncaloneves/likescounter