{"id":120371,"date":"2014-10-15T10:53:59","date_gmt":"2014-10-15T08:53:59","guid":{"rendered":"http:\/\/designmodo.com\/?p=120371"},"modified":"2025-11-11T10:13:06","modified_gmt":"2025-11-11T10:13:06","slug":"social-share-count-wordpress","status":"publish","type":"post","link":"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/","title":{"rendered":"How to Display Social Share Counts in WordPress as Text"},"content":{"rendered":"<p>In the first part of this series, I showed you how to programmatically retrieve the share count of various social media networks from their respective APIs using PHP.<\/p>\n<p>In this final part, we will develop a WordPress plugin that displays the number of Facebook likes, Twitter posts, and social share count of a specific URL.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/strictthemes.com\/articles\/wp-content\/uploads\/2024\/06\/StrictThemes-banner.jpg\" alt=\"StrictThemes\" width=\"1180\" height=\"552\" class=\"alignnone size-full wp-image-297437\" \/><\/p>\n<p>To <strong>display the share count of a social network in a WordPress<\/strong> post or page, embed the shortcode of the social network as defined by the plugin. Let&#8217;s get started with the plugin development.<\/p>\n<h2>Plugin Development<\/h2>\n<p>First, create a folder where all of the plugin files will be stored. Let&#8217;s name it <code>designmodo-social-count<\/code>.<\/p>\n<p>Include the plugin header in the plugin PHP file. Without the header, WordPress will not recognize the plugin.<\/p>\n<p>[php]<br \/>\n&amp;lt;?php<\/p>\n<p>\/*<br \/>\nPlugin Name: Designmodo Social Media Count<br \/>\nPlugin URI: https:\/\/designmodo.com<br \/>\nDescription: Display social media count.<br \/>\nVersion: 1.0<br \/>\nAuthor: Agbonghama Collins<br \/>\nAuthor URI: https:\/\/w3guy.com<br \/>\n*\/<br \/>\n[\/php]<\/p>\n<p>Create the PHP class and initialize the required methods at the magic <code>__construct<\/code>.<\/p>\n<p>[php]<br \/>\nclass Designmodo_Social_Count {<\/p>\n<p>\tfunction __construct() {<\/p>\n<p>\t\tadd_shortcode( &#8216;facebook-share&#8217;, array( $this, &#8216;facebook_share&#8217; ) );<\/p>\n<p>\t\tadd_shortcode( &#8216;facebook-page-like&#8217;, array( $this, &#8216;facebook_page_like&#8217; ) );<\/p>\n<p>\t\tadd_shortcode( &#8216;pinterest-count&#8217;, array( $this, &#8216;pinterest_count&#8217; ) );<\/p>\n<p>\t\tadd_shortcode( &#8216;tweet-count&#8217;, array( $this, &#8216;tweet_count&#8217; ) );<\/p>\n<p>\t\tadd_shortcode( &#8216;google-plus&#8217;, array( $this, &#8216;google_plus_count&#8217; ) );<\/p>\n<p>\t\tadd_shortcode( &#8216;linkedin-share&#8217;, array( $this, &#8216;linkedin_share&#8217; ) );<\/p>\n<p>\t\tadd_shortcode( &#8216;stumbledupon&#8217;, array( $this, &#8216;stumbledupon_share&#8217; ) );<br \/>\n\t}<br \/>\n[\/php]<\/p>\n<p>In the code above, we defined the shortcode (first function argument) for the various social networks and their respective callback function (second function argument) via the <code>add_shortcode<\/code> function.<\/p>\n<p>Before we start writing code for the various shortcode callback functions, we&#8217;ll create two helper class methods that accept an API call as its parameter and return the JSON output back to the callback function for processing.<\/p>\n<p>Below are the two helper functions: <code>get_response_body<\/code> and <code>post_response_body<\/code><\/p>\n<p>[php]<br \/>\n\tfunction get_response_body( $url, $type = &#8221; ) {<\/p>\n<p>\t\t$response = wp_remote_get( $url );<br \/>\n\t\t$body     = wp_remote_retrieve_body( $response );<\/p>\n<p>\t\t\/\/ if api call is pinterest, make the response pure json<br \/>\n\t\tif ( $type == &#8216;pinterest&#8217; ) {<br \/>\n\t\t\t$body = preg_replace( &#8216;\/^receiveCount\\((.*)\\)$\/&#8217;, &#8216;\\\\1&#8217;, $body );<br \/>\n\t\t}<\/p>\n<p>\t\treturn json_decode( $body );<br \/>\n\t}<br \/>\n[\/php]<\/p>\n<p>[php]<br \/>\n\tfunction post_response_body( $url ) {<\/p>\n<p>\t\t$query = &#8216;<br \/>\n\t\t[{<br \/>\n\t\t    &amp;quot;method&amp;quot;: &amp;quot;pos.plusones.get&amp;quot;,<br \/>\n\t\t    &amp;quot;id&amp;quot;: &amp;quot;p&amp;quot;,<br \/>\n\t\t    &amp;quot;params&amp;quot;: {&amp;quot;nolog&amp;quot;: true, &amp;quot;id&amp;quot;: &amp;quot;&#8217; . $url . &#8216;&amp;quot;, &amp;quot;source&amp;quot;: &amp;quot;widget&amp;quot;, &amp;quot;userId&amp;quot;: &amp;quot;@viewer&amp;quot;, &amp;quot;groupId&amp;quot;: &amp;quot;@self&amp;quot;},<br \/>\n\t\t    &amp;quot;jsonrpc&amp;quot;: &amp;quot;2.0&amp;quot;,<br \/>\n\t\t    &amp;quot;key&amp;quot;: &amp;quot;p&amp;quot;,<br \/>\n\t\t    &amp;quot;apiVersion&amp;quot;: &amp;quot;v1&amp;quot;<br \/>\n\t\t}]<br \/>\n\t\t&#8216;;<\/p>\n<p>\t\t$response = wp_remote_post(<br \/>\n\t\t\t&#8216;https:\/\/clients6.google.com\/rpc&#8217;,<br \/>\n\t\t\tarray(<br \/>\n\t\t\t\t&#8216;headers&#8217; =&amp;gt; array( &#8216;Content-type&#8217; =&amp;gt; &#8216;application\/json&#8217; ),<br \/>\n\t\t\t\t&#8216;body&#8217;    =&amp;gt; $query<br \/>\n\t\t\t)<br \/>\n\t\t);<\/p>\n<p>\t\treturn json_decode( wp_remote_retrieve_body( $response ), true );<br \/>\n\t}<br \/>\n[\/php]<\/p>\n<p>The initial will handle GET request for the entire social network we are majoring except that of Google+ (a POST request), which will be handled by the latter.<\/p>\n<p>When the shortcode for Facebook likes and share count is active <code>[facebook-share url=\"https:\/\/xyz.com\"]<\/code>, the callback function <code>facebook_share<\/code> is called.<\/p>\n<p>[php]<br \/>\nfunction facebook_share( $atts ) {<br \/>\n\t\t$url      = $atts[&#8216;url&#8217;];<br \/>\n\t\t$api_call = &#8216;https:\/\/graph.facebook.com\/?id=&#8217; . $url;<\/p>\n<p>\t\treturn $this-&amp;gt;get_response_body( $api_call )-&amp;gt;shares . &#8216; Facebook Likes &amp;amp; Shares&#8217;;<\/p>\n<p>\t}<br \/>\n[\/php]<\/p>\n<p>The <code>facebook_page_like()<\/code> below is the callback function for the <strong>Facebook page like<\/strong> shortcode.<\/p>\n<p>[php]<br \/>\nfunction facebook_page_like( $atts ) {<br \/>\n\t\t$username = $atts[&#8216;username&#8217;];<br \/>\n\t\t$api_call = &#8216;https:\/\/graph.facebook.com\/?id=https:\/\/facebook.com\/&#8217; . $username;<\/p>\n<p>\t\treturn $this-&amp;gt;get_response_body( $api_call )-&amp;gt;likes . &#8216; Facebook Page Like&#8217;;<br \/>\n\t}<br \/>\n[\/php]<\/p>\n<p>The function <code>pinterest_count<\/code> is the callback function for the <em>Pinterest share<\/em> shortcode.<\/p>\n<p>[php]<br \/>\nfunction pinterest_count( $atts ) {<\/p>\n<p>\t\t$url      = $atts[&#8216;url&#8217;];<br \/>\n\t\t$api_call = &#8216;https:\/\/api.pinterest.com\/v1\/urls\/count.json?callback%20&amp;amp;url=&#8217; . $url;<\/p>\n<p>\t\treturn $this-&amp;gt;get_response_body( $api_call, &#8216;pinterest&#8217; )-&amp;gt;count . &#8216; Pinterest Pins&#8217;;<br \/>\n\t}<br \/>\n[\/php]<\/p>\n<p>When the shortcode for the Twitter tweet count is active, <code>tweet_count<\/code> callback function is called.<\/p>\n<p>[php]<br \/>\nfunction tweet_count( $atts ) {<\/p>\n<p>\t\t$url      = $atts[&#8216;url&#8217;];<br \/>\n\t\t$api_call = &#8216;https:\/\/cdn.api.twitter.com\/1\/urls\/count.json?url=&#8217; . $url;<\/p>\n<p>\t\treturn $this-&amp;amp;gt;get_response_body( $api_call )-&amp;amp;gt;count . &#8216; Tweets&#8217;;<\/p>\n<p>\t}<br \/>\n[\/php]<\/p>\n<p>The callback function for LinkedIn share is <code>linkedin_share<\/code>.<\/p>\n<p>[php]<br \/>\nfunction linkedin_share( $atts ) {<br \/>\n\t\t$url      = $atts[&#8216;url&#8217;];<br \/>\n\t\t$api_call = &#8216;https:\/\/www.linkedin.com\/countserv\/count\/share?url=&#8217; . $url . &#8216;&amp;amp;amp;format=json&#8217;;<br \/>\n\t\t$count    = $this-&amp;amp;gt;get_response_body( $api_call )-&amp;amp;gt;count;<\/p>\n<p>\t\treturn $count . &#8216; LinkedIn Shares&#8217;;<br \/>\n\t}<br \/>\n[\/php]<\/p>\n<p><code>stumbledupon_share<\/code> is the callback function for StumbleUpon.<\/p>\n<p>[php]<br \/>\nfunction stumbledupon_share( $atts ) {<br \/>\n\t\t$url      = $atts[&#8216;url&#8217;];<br \/>\n\t\t$api_call = &#8216;https:\/\/www.stumbleupon.com\/services\/1.01\/badge.getinfo?url=&#8217; . $url;<br \/>\n\t\t$count    = $this-&amp;gt;get_response_body( $api_call )-&amp;gt;result-&amp;gt;views;<\/p>\n<p>\t\treturn $count . &#8216; Stumbles&#8217;;<br \/>\n\t}<br \/>\n[\/php]<\/p>\n<p><code>google_plus_count()<\/code> is the callback function for the Google+ shortcode.<\/p>\n<p>[php]<br \/>\nfunction google_plus_count( $atts ) {<br \/>\n\t\t$url   = $atts[&#8216;url&#8217;];<br \/>\n\t\t$count = $this-&amp;gt;post_response_body( $url )[0][&#8216;result&#8217;][&#8216;metadata&#8217;][&#8216;globalCounts&#8217;][&#8216;count&#8217;];<\/p>\n<p>\t\treturn $count . &#8216; Google Plus&#8217;;<br \/>\n\t}<br \/>\n[\/php]<\/p>\n<p>Below is the singleton method that will instantiate the class to make it active.<\/p>\n<p>[php]<br \/>\nstatic function get_instance() {<br \/>\n\t\tstatic $instance = false;<\/p>\n<p>\t\tif ( ! $instance ) {<br \/>\n\t\t\t$instance = new self;<br \/>\n\t\t}<\/p>\n<p>\t}<br \/>\n[\/php]<\/p>\n<p>Finally, we will make a call to the singleton method <code>get_instance()<\/code> to instantiate the class.<\/p>\n<p>[php]<br \/>\nDesignmodo_Social_Count::get_instance();<br \/>\n[\/php]<\/p>\n<p>Voila! We are done coding our <strong>social share count<\/strong> plugin.<\/p>\n<h2>How to Use the Plugin<\/h2>\n<p>Using the URL <code>https:\/\/designmodo.com\/<\/code> as our example:<\/p>\n<p>To get the number of Facebook likes and shares for the URL, use the shortcode <code>[facebook-share url=\"https:\/\/designmodo.com\/\"]<\/code><\/p>\n<p>Pinterest share count <code>[pinterest-count url=\"https:\/\/designmodo.com\/\"]<\/code><\/p>\n<p>Tweet count <code>[tweet-count url=\"https:\/\/designmodo.com\/\"]<\/code><\/p>\n<p>Google PlusOnes <code>[google-plus url=\"https:\/\/designmodo.com\"]<\/code><\/p>\n<p>LinkedIn shares <code>[linkedin-share url=\"https:\/\/designmodo.com\"]<\/code><\/p>\n<p>StumbleUpon stumbles <code>[stumbledupon url=\"https:\/\/designmodo.com\/\"]<\/code><\/p>\n<p>To display the number of likes a Facebook page has, use this shortcode <code>[facebook-page-like username=\"designmodo\"]<\/code> where <em>designmodo<\/em> is the page&#8217;s username.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-120382\" src=\"https:\/\/strictthemes.com\/articles\/wp-content\/uploads\/2024\/06\/designmodo-social-share-shortcodes-600x361.png\" alt=\"Designmodo Social Share Shortcodes\" width=\"600\" height=\"361\" \/><\/p>\n<p>Say you added all the shortcodes above in a WordPress post or page, you will see the social share count display as depicted in the image below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-120384\" src=\"https:\/\/strictthemes.com\/articles\/wp-content\/uploads\/2024\/06\/social-share-in-action.jpg\" alt=\"Social share count in Action\" width=\"422\" height=\"518\" \/><\/p>\n<h2>Conclusion and Download<\/h2>\n<p>[emaillocker]<br \/>\nTo further understand how the plugin was built and how you can implement it in your WordPress site, <a href=\"https:\/\/www.dropbox.com\/scl\/fi\/4gb7sm0dpgy2nhul40wo4\/designmodo-social-count.zip?rlkey=1sxlsbpqdruxud4e6fiigwzay&amp;e=1&amp;dl=0\">download the plugin<\/a>. Have a question, contribution or suggestion for code improvement? Let us know in the comments.<br \/>\n[\/emaillocker]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the first part of this series, I showed you how to programmatically retrieve the share count of various social media networks from their respective APIs using PHP. In this final part, we will develop a WordPress plugin that displays the number of Facebook likes, Twitter posts, and social share count of a specific URL. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":122422,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"class_list":["post-120371","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress"],"blocksy_meta":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Display Social Share Counts in WordPress as Text - WordPress Guides<\/title>\n<meta name=\"description\" content=\"In this final part, we will develop a WordPress plugin that displays the number of Facebook likes, Twitter posts, and social share count of a specific URL.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Display Social Share Counts in WordPress as Text - WordPress Guides\" \/>\n<meta property=\"og:description\" content=\"In this final part, we will develop a WordPress plugin that displays the number of Facebook likes, Twitter posts, and social share count of a specific URL.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"WordPress Guides\" \/>\n<meta property=\"article:published_time\" content=\"2014-10-15T08:53:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-11T10:13:06+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/strictthemes.com\/articles\/#\/schema\/person\/0494d35a2138fb6ca85de8d8c107cea3\"},\"headline\":\"How to Display Social Share Counts in WordPress as Text\",\"datePublished\":\"2014-10-15T08:53:59+00:00\",\"dateModified\":\"2025-11-11T10:13:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/\"},\"wordCount\":1057,\"commentCount\":6,\"publisher\":{\"@id\":\"https:\/\/strictthemes.com\/articles\/#organization\"},\"image\":{\"@id\":\"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/#primaryimage\"},\"thumbnailUrl\":\"\",\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/\",\"url\":\"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/\",\"name\":\"How to Display Social Share Counts in WordPress as Text - WordPress Guides\",\"isPartOf\":{\"@id\":\"https:\/\/strictthemes.com\/articles\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/#primaryimage\"},\"thumbnailUrl\":\"\",\"datePublished\":\"2014-10-15T08:53:59+00:00\",\"dateModified\":\"2025-11-11T10:13:06+00:00\",\"description\":\"In this final part, we will develop a WordPress plugin that displays the number of Facebook likes, Twitter posts, and social share count of a specific URL.\",\"breadcrumb\":{\"@id\":\"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/#primaryimage\",\"url\":\"\",\"contentUrl\":\"\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/strictthemes.com\/articles\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Display Social Share Counts in WordPress as Text\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/strictthemes.com\/articles\/#website\",\"url\":\"https:\/\/strictthemes.com\/articles\/\",\"name\":\"WordPress Guides\",\"description\":\"Create WordPress websites for begginers.\",\"publisher\":{\"@id\":\"https:\/\/strictthemes.com\/articles\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/strictthemes.com\/articles\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/strictthemes.com\/articles\/#organization\",\"name\":\"WordPress Guides\",\"url\":\"https:\/\/strictthemes.com\/articles\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/strictthemes.com\/articles\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/strictthemes.com\/articles\/wp-content\/uploads\/2021\/02\/logo.png\",\"contentUrl\":\"https:\/\/strictthemes.com\/articles\/wp-content\/uploads\/2021\/02\/logo.png\",\"width\":500,\"height\":500,\"caption\":\"WordPress Guides\"},\"image\":{\"@id\":\"https:\/\/strictthemes.com\/articles\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/strictthemes.com\/articles\/#\/schema\/person\/0494d35a2138fb6ca85de8d8c107cea3\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/0f3e4f16181fb8c4f52d8ce92b721be0a10c6988bdb5a145b784cde45f5ef679?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0f3e4f16181fb8c4f52d8ce92b721be0a10c6988bdb5a145b784cde45f5ef679?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0f3e4f16181fb8c4f52d8ce92b721be0a10c6988bdb5a145b784cde45f5ef679?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/strictthemes.com\/articles\"],\"url\":\"https:\/\/strictthemes.com\/articles\/author\/andrian\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Display Social Share Counts in WordPress as Text - WordPress Guides","description":"In this final part, we will develop a WordPress plugin that displays the number of Facebook likes, Twitter posts, and social share count of a specific URL.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"How to Display Social Share Counts in WordPress as Text - WordPress Guides","og_description":"In this final part, we will develop a WordPress plugin that displays the number of Facebook likes, Twitter posts, and social share count of a specific URL.","og_url":"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/","og_site_name":"WordPress Guides","article_published_time":"2014-10-15T08:53:59+00:00","article_modified_time":"2025-11-11T10:13:06+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/#article","isPartOf":{"@id":"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/"},"author":{"name":"admin","@id":"https:\/\/strictthemes.com\/articles\/#\/schema\/person\/0494d35a2138fb6ca85de8d8c107cea3"},"headline":"How to Display Social Share Counts in WordPress as Text","datePublished":"2014-10-15T08:53:59+00:00","dateModified":"2025-11-11T10:13:06+00:00","mainEntityOfPage":{"@id":"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/"},"wordCount":1057,"commentCount":6,"publisher":{"@id":"https:\/\/strictthemes.com\/articles\/#organization"},"image":{"@id":"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/#primaryimage"},"thumbnailUrl":"","articleSection":["WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/","url":"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/","name":"How to Display Social Share Counts in WordPress as Text - WordPress Guides","isPartOf":{"@id":"https:\/\/strictthemes.com\/articles\/#website"},"primaryImageOfPage":{"@id":"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/#primaryimage"},"image":{"@id":"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/#primaryimage"},"thumbnailUrl":"","datePublished":"2014-10-15T08:53:59+00:00","dateModified":"2025-11-11T10:13:06+00:00","description":"In this final part, we will develop a WordPress plugin that displays the number of Facebook likes, Twitter posts, and social share count of a specific URL.","breadcrumb":{"@id":"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/#primaryimage","url":"","contentUrl":""},{"@type":"BreadcrumbList","@id":"https:\/\/strictthemes.com\/articles\/social-share-count-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/strictthemes.com\/articles\/"},{"@type":"ListItem","position":2,"name":"How to Display Social Share Counts in WordPress as Text"}]},{"@type":"WebSite","@id":"https:\/\/strictthemes.com\/articles\/#website","url":"https:\/\/strictthemes.com\/articles\/","name":"WordPress Guides","description":"Create WordPress websites for begginers.","publisher":{"@id":"https:\/\/strictthemes.com\/articles\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/strictthemes.com\/articles\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/strictthemes.com\/articles\/#organization","name":"WordPress Guides","url":"https:\/\/strictthemes.com\/articles\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/strictthemes.com\/articles\/#\/schema\/logo\/image\/","url":"https:\/\/strictthemes.com\/articles\/wp-content\/uploads\/2021\/02\/logo.png","contentUrl":"https:\/\/strictthemes.com\/articles\/wp-content\/uploads\/2021\/02\/logo.png","width":500,"height":500,"caption":"WordPress Guides"},"image":{"@id":"https:\/\/strictthemes.com\/articles\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/strictthemes.com\/articles\/#\/schema\/person\/0494d35a2138fb6ca85de8d8c107cea3","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0f3e4f16181fb8c4f52d8ce92b721be0a10c6988bdb5a145b784cde45f5ef679?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0f3e4f16181fb8c4f52d8ce92b721be0a10c6988bdb5a145b784cde45f5ef679?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0f3e4f16181fb8c4f52d8ce92b721be0a10c6988bdb5a145b784cde45f5ef679?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/strictthemes.com\/articles"],"url":"https:\/\/strictthemes.com\/articles\/author\/andrian\/"}]}},"_links":{"self":[{"href":"https:\/\/strictthemes.com\/articles\/wp-json\/wp\/v2\/posts\/120371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/strictthemes.com\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/strictthemes.com\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/strictthemes.com\/articles\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/strictthemes.com\/articles\/wp-json\/wp\/v2\/comments?post=120371"}],"version-history":[{"count":4,"href":"https:\/\/strictthemes.com\/articles\/wp-json\/wp\/v2\/posts\/120371\/revisions"}],"predecessor-version":[{"id":690248,"href":"https:\/\/strictthemes.com\/articles\/wp-json\/wp\/v2\/posts\/120371\/revisions\/690248"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/strictthemes.com\/articles\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/strictthemes.com\/articles\/wp-json\/wp\/v2\/media?parent=120371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/strictthemes.com\/articles\/wp-json\/wp\/v2\/categories?post=120371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/strictthemes.com\/articles\/wp-json\/wp\/v2\/tags?post=120371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}