As we all are aware of the professional network LinkedIn, which is a business adapted social networking website. With the growing network on social media websites like Twitter and Facebook, LinkedIn has also launched its official share button.
LinkedIn share button works same as Twitter Share button, Tweetmeme and Facebook Like Button which help bloggers to share articles around the network. In this post we will learn to add official linkedin button for wordpress blog.
LinkedIn buttons are simple to use and need not require any configurations. There are three types of LinkedIn buttons, developed to fit with different layouts schemes, they are Vertical Count, Horizontal Count and No Count.
Below are different buttons with the respective code snippets:
Vertical LinkedIn Button
Vertical Count button displays the counter above the button as you can see the image above. The code for vertical button is as under:
<script type="text/javascript" src="http://platform.linkedin.com/in.js"></script> <script type="in/share" data-url="<?php the_permalink(); ?>" data-counter="top"></script>
Horizontal LinkedIn Button
Horizontal Count button displays the counter on right of the button, as you can see it in the picture above. The code for horizontal button is as under:
<script type="text/javascript" src="http://platform.linkedin.com/in.js"></script> <script type="in/share" data-url="<?php the_permalink(); ?>" data-counter="right"></script>
No Count
This is a simple linkedin button which doesn’t display any counter. You can see this button in above image preview. The code for simple LinkedIn button is as under:
<script type="text/javascript" src="http://platform.linkedin.com/in.js"></script> <script type="in/share" data-url="<?php the_permalink(); ?>"></script>
Add LinkedIn button in WordPress
Make sure you take backup before editing the code.
Choose the appropriate button above for your Theme and simply open up your theme file, for instance Single.php and add linkedin button code within post loop. Once done, upload the file server and refresh the blog to see the effect.
There are also plugins developed for LinkedIn button, but in order avoid plugin dependency, one should prefer adding the codes manually. You can also visit Official LinkedIn resources for Publishers.
This ends a simple tutorial to add linkedin button in wordpress. If you have any query or further assistance is required, post comment as your feedback.
Some of the code is messed up, anchor tags etc……best to amend or confuse people a bit.
Aah, code has been fixed now. Sorry for the Inconvenience caused. 🙂