If you’re using the “Included Total” option to display your total share count, the code below will let you hide the count if it is below a certain threshold. In the code below, we are only showing the total if it is greater than 100.
Author: Bill Erickson
Bill Erickson is a freelance WordPress developer and a contributor 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.
Change the theme location for share buttons
You can set Shared Counts to automatically insert the buttons before and/or after the content of your page. The hook or filter used will depend upon your theme (see the code here): If you are using a Genesis theme: “Before” uses the genesis_entry_header hook with a priority of 13 “After” uses the genesis_entry_footer hook with […]
Display share buttons using a shortcode
You can use FacebookTweetPinEmailPrint shortcode to display share buttons anywhere in your page’s content. Here are the optional attributes you can add to customize the display: location: adds a CSS class to the shared-counts-wrap so you can apply location-specific styling. By default it automatically has the location of “shortcode” style: specify a button style for […]
Manually display share buttons using a function
You can call the display method within your theme or plugin file to include the share buttons. The “function exists” part ensures this code only runs if Shared Counts is active. You can also pass the following parameters to the display method: Location: adds a CSS class to the shared-counts-wrap so you can apply location-specific […]
Show total share count for “included total” field
The “Included Total” field in Shared Counts displays the sum total of counts across all the other buttons you’re displaying. It does not use the “total” value you see when editing a post. For instance, if you don’t include a Pinterest button on your site, it won’t include your Pinterest pins in the count total. […]
Use production URL when in development or staging
You can modify what URL is used to find share counts, and what URL is shared when a share button is clicked. This is useful when you’re building a website locally or in a staging environment and want to see the actual counts for the production (live) version of a post.