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 […]
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 […]
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 […]
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” […]
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 […]
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:
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 […]
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.
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.