How To Add LinkedIn Share Button To Website Below Each Post?
October 10th, 2016 | by Ravi Chahar || 8 Comments |
For a website, it’s important to have the social sharing buttons below each post so that your readers can spread the love. Do you know how to add LinkedIn share button to website?
Most of the users add the sharing buttons using the plugins. It’s because, for a non-techie person, it would be a quite hard to understand the concept of coding.
In this tutorial, I am going to tell you how to add LinkedIn share button to website without using any plugin. You just have to use the LinkedIn script and the WordPress function.
Use The LinkedIn Code Generator To Add The Share Button.
If you don’t know, let me tell you that LinkedIn has many buttons to add to your website. And here you need the share button.
So with the LinkedIn generator, you can generate the code and it would be similar to the code shown below.
<script type=”IN/Share” data-url=”http://www.yourwebsite.com” data-counter=”top”></script>
In the above code the main URL of the domain would be shared. But you need to add LinkedIn share button to website below each post.
It can be done by replacing the URL of your website with the WordPress function.
There are three types of codes depending on the position of the number of counts.
For Vertical Count.
<script type=”IN/Share” data-url=”<?php the_permalink(); ?>” data-counter=”top”></script>
For Horizontal Count.
<script type=”IN/Share” data-url=”<?php the_permalink(); ?>” data-counter=”right”></script>
For No Count.
<script type=”IN/Share” data-url=”<?php the_permalink(); ?>”></script>
In all the three codes, you have to add the permalink function of WordPress. It would pick up the permalink of each post of your website to get shared on LinkedIn.
And the position of the number of shares can be adjusted as shown above. The “data-counter” option is handling it. If you don’t want to show the counts then remove it from the code as shown in the final code.
Do You Now Know How To Add LinkedIn Share Button To Website?
There is always a taboo about using the codes. People get afraid. The only thing you need to understand is the concept.
And adding the LinkedIn share button is so easy. Just edit the script provided by the LinkedIn generator. You can do a lot of things with this code.
If you want to add the follow button to your website then just copy and paste the code from LinkedIn. You won’t need to edit it.
You have successfully added the share button. If you have any doubt, feel free to clear it.