How To Add LinkedIn Share Button To Website Below Each Post
February 5th, 2018 | by Ravi Chahar || 10 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 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.
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.
NOTE: To make it work on every post, you have to replace the URL of your website with the WordPress function.
data-url=”<?php the_permalink(); ?>”
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.