EA Share Count – Change button location based on share count

This is in use on my blog. Posts with 10 or less shares only display share buttons at the bottom, encouraging readers to share. Posts with more than 10 shares also have the buttons at the top, for social proof.

* Change button location based on share count
* @author Bill Erickson
* @link http://www.billerickson.net/code/easc-location-based-on-share-count
* @param array $locations
* @return array $locations
function be_easc_location( $locations ) {
$total = ea_share()->core->count( false, 'included_total' );
if( 10 > $total ) {
$locations['before']['hook'] = false;
$locations['before']['filter'] = false;
return $locations;
add_filter( 'ea_share_count_theme_locations', 'be_easc_location' );
view raw functions.php hosted with ❤ by GitHub

Bill Erickson

Bill Erickson is a freelance WordPress developer and a contributing developer to the Genesis framework. For the past 14 years he has worked with attorneys, publishers, corporations, and non-profits, building custom websites tailored to their needs and goals.

Ready to upgrade your website?

I build custom WordPress websites that look great and are easy to manage.

Let's Talk