We just released version 1.3 of Shared Counts, which includes some great new features and improvements. Twitter counts using TwitCount Our previous provider of Twitter share counts shut down, so we’ve added support for the new leader in Twitter counts, TwitCount. Sign up for free on the TwitCount website, then on your website go to […]
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.
Disable the plugin’s CSS and JavaScript
Shared Counts loads a stylesheet which contains the styling for the many style options offered by this plugin. You can prevent our stylesheet with the following code: Make sure you include your own styling for the Shared Counts buttons in your theme’s stylesheet. Disable JavaScript Shared Counts includes a JavaScript file for the following functionality: […]
Change how often share counts refresh
Shared Counts uses smart caching to minimize API queries since they can slow down the load time for visitors. We refresh recent content more often. Posts published in the last 24 hours are updated every 30 minutes Posts published in the last 5 days are updated every 6 hours Posts older than that are updated […]
Display list of popular posts sorted by share count
Shared Counts stores the total share count as post metadata using the shared_counts_total key. This lets you easily query for popular content Query with code To query for a list of your posts with the highest share count: You can also combine this with more advanced queries. Here’s a list of posts published in the […]
Display different buttons in each location
In Settings > Shared Counts you can control the site-wide settings for which share buttons are shown and where they appear (before and/or after content). For more fine grained control, you can use the shared_counts_display_services filter (added in version 1.3) to customize which services are available in each location. You might also be interested in […]
Use different button styles before and after content
In Settings > Shared Counts you can select a button style and whether they appear above and/or below the post content. But what if you want to use different button styles in those locations? You can use the shared_counts_theme_locations filter to customize the settings for each location. Let’s say you want to use the “Classic” […]
Add a Reddit share button
Shared Counts includes buttons for the most popular social sharing platforms, and you can use the built-in filters to add support for additional services. The code below adds a Reddit share button. Note that this will not increase the total share count when shared on reddit. This only adds a sharing button. Here’s some information […]
Use “Shares” for included total field label
When using the “Included Total” field with the Icons style, the output looks something like this: With the following code, you can change it to “Shares” for multiple shares, or “Share” if there’s only one share, like this:
Disable share buttons on certain categories
Shared Counts lets you specify where in a post the share buttons appear (before and/or after content). You can also exclude them on a specific post using the metabox when editing that post. For even more control, you can use the locations filter to move or remove the share buttons programmatically. The code below removes […]
Add twitter username to shared tweets
The following code snippet will add your twitter username to the end of a tweet shared from your website. Make sure to change “billerickson” to your twitter username.