Disable Share Counts on a page template

EA Share Count includes a checkbox when editing a page, “Don’t display buttons on this page”. If you have a page template you always want it disabled on, and don’t want to manually check this on each of those pages, you can include this code in your page template:

 * Disable Sharing
function ea_disable_social_sharing( $value, $post_id, $meta_key, $single  ) {
	if( 'ea_share_count_exclude' == $meta_key )
		$value = true;
	return $value;
add_filter( 'get_post_metadata', 'ea_disable_social_sharing', 10, 4 );

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