Articles of social sharing

Multiple social buttons with a fast loading?

I have pages like this with a lot of social buttons. A lot means more than 50 buttons because each posts on that page has its own buttons. So maybe I’ll make the page smaller, with less posts but this is not the main reason and not what I am looking for. I want to […]

Is there a way to change a post's thumbnail image(s)?

I just recently finished the first version of a blog (here: http://northernconservative.com/ ), but whenever I share a post on social media, the thumbnail image is the atrocious scaled up version of one of the social media icon’s I have on the footer. I would really like that the thumbnail image be the logo which […]

How to generate “og:image” meta for Facebook sharing when the image in the post is not featured?

I have a piece of code in my website’s header.php that can generate og:image meta data for FB sharing. It works perfectly when the given post has a featured image. <?php $fb_image = wp_get_attachment_image_src(get_post_thumbnail_id( get_the_ID() ), ‘480’); ?> <?php if ($fb_image) : ?> <meta property=”og:image” content=”<?php echo $fb_image[0]; ?>” /> <?php endif; ?> I would […]

List repeating share links

I want to add social share buttons to my posts, but I don’t want to put all that big bulk of code into all my content files. I want to create a function, and then add the function name to my template files, something like this: function pietergoosen_sosiale_netwerk_deel_knoppies() { <strong>Deel die pos met ander</strong><p </p> […]

Social sharing post's shortlink instead of permalink

Is there a way to force a social sharing plugin to use the shortlink each of my WP posts automatically gets (YOURLS service in my case) to pass to the social service the visitor clicked, instead of permalink? If not, it has to be built with that functionality? (not that I have found any that […]

Retrieving Google Plus share count with wp_remote_post

So I’ve spent most of my morning working on my website’s customized social share buttons. Reading out Twitter and Facebook shares were no problem, but Google Plus is a real challenge, as they don’t offer an easy-to-use GET API. I found a working technique using barebones CURL ( http://www.tomanthony.co.uk/blog/google_plus_one_button_seo_count_api/comment-page-1/ ). But previously, I’ve tried hard […]

Get total social share count (Facebook, Twitter, Google+. Pinterest)

I’m pulling the individual share counts for the social media I’ve mentioned using the following code snippet in my theme’s function.php: $facebook_like_share_count = function ( $url ) { $api = file_get_contents( ‘http://graph.facebook.com/?id=’ . $url ); $count = json_decode( $api ); return $count->shares; }; $twitter_tweet_count = function ( $url ) { $api = file_get_contents( ‘https://cdn.api.twitter.com/1/urls/count.json?url=’ . […]

How can i disable a plugin for a mobile phone?

Is there a way I can not show something to mobile users? I have a floating social bar on my responsive theme, but it get in the middle of the content if I’m on my Android phone. I don’t want to use display:none, since the JS will still load. Is there a function I can […]

Storing posts social counters by using transient api

I would like to know if it’s a good practice to use transient api to cache social counters for every post. Loading post pages get quite slow while processing and getting all social APIs.