There might be times when it's necessary to count the number of times a URL has been shared to LinkedIn. Used by website owners as a type of vanity stamp, and used by marketers as a basic means of determining popularity, the shortcode below will retrieve the count, cache the result for a defined period, then return the share count to your page.
Twitter carelessly removed their own (unofficial) count API in 2015, and Google recently disabled their own +1 feature (and associated count), so it may be only a matter of time before LinkedIn follows precedent and does the same.
Given that the LinkedIn count for our BeliefMedia articles is low (the site is new), we'll use the count for the same article on the now-retired Internoetics. The shortcode of
[linkedinshares url="http://www.internoetics.com/2012/05/16/co ... gleplus/"] (snipped ). The result: 12.
Copy and paste the WordPress function into your theme's
functions.php file or, if you sensibly have one installed, your custom functions plugin. You may optionally download and install our plugin from the bottom of of the page.
n="0"or hardcode into the function to disable.
Used outside of WordPress, the following function may be used. Usage of Simple Cache is required.