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

Bill Erickson

Bill Erickson is the co-founder and lead developer at CultivateWP, a WordPress agency focusing on high performance sites for web publishers.

About Me
Ready to upgrade your website?

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

Let's Talk