EA Share Count – Prime the Pump

EA Share Count only loads share data when the counts are called. When you first install it, there won’t be any share count data. If you are using the share counts for a “popular posts” widget, you’ll want to gather share data for many posts quickly. This function lets you do that.

<?php
/**
* Gather data on recent posts
*
*/
function be_gather_share_data() {
ea_share()->core->prime_the_pump( 100, 20, true );
// 100 = total posts you want with share counts
// 20 = how many posts to process in one pageload
// true = whether to display a message indicating status (requires ea_pp() )
}
add_action( 'wp_footer', 'be_gather_share_data' );
view raw functions.php hosted with ❤ by GitHub

EA Share Count

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