How To Add LinkedIn Share Button To Website Below Each Post?

how to add linkedin share button to website

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 src=”//platform.linkedin.com/in.js” type=”text/javascript”> lang: en_US</script>
<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 src=”//platform.linkedin.com/in.js” type=”text/javascript”> lang: en_US</script>
<script type=”IN/Share” data-url=”<?php the_permalink(); ?>” data-counter=”top”></script>

For Horizontal Count.

<script src=”//platform.linkedin.com/in.js” type=”text/javascript”> lang: en_US</script>
<script type=”IN/Share” data-url=”<?php the_permalink(); ?>” data-counter=”right”></script>

For No Count.

<script src=”//platform.linkedin.com/in.js” type=”text/javascript”> lang: en_US</script>
<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.

by Ravi Chahar

A blogger, web developer, and designer who intends to guide his readers about WordPress, Blogging, Web Development, Web Design and more. I have expertise in WordPress theme development and customization. I can set up and redesign the Thesis themes. I have been working in this field for years now.

8 comments

  1. Hi there Ravi,

    Actually I haven’t use linkedin from the begginning but lately when I saw it’s powers I just jumped to it. It’s your resume for the work that you wanna get (that stands the word linkedin for me).

    Actually is a good idea adding linkedin to the blog, since many bloggers already use it.

    Cheers,

    Clay.

    1. Hey Clay,

      LinkedIn is the biggest professional network and you can reach to many people. The sharing button to our website can help you to get more traffic.
      People like to spread the love.
      Thanks for stopping by.
      Enjoy your day.
      ~Ravi

  2. LinkedIn was always remain strong when it comes to business networking. You build your network, work together, share your work, get job, offer job, we can do many more things on this network. This networking platform is widely used by people all over the world, adding LinkedIn sharing button to you website or blog definitely prove beneficial, as people can share their favorite story or article with his network.

    1. Hey Ryan,

      No doubt that LinkedIn has helped many people to get a job. From your blog, you can get many followers. the sharing button can help you to leverage your blog post.
      Thanks for commenting.
      ~Ravi

    1. Hey Carolyn,

      Most of the WordPress users go with the plugins. But if you can do it with the code then what’s the need to increase one more plugin.
      Thanks for commenting.
      ~Ravi

Leave a Reply

Your email address will not be published. Required fields are marked *

CommentLuv badge