Monday, November 30, 2020
Home Blogging How to Add Official LinkedIn Share Button in WordPress

How to Add Official LinkedIn Share Button in WordPress

Do you need to add the official LinkedIn share button in WordPress? There are various social media plugins that let you add share buttons, however most of them don’t use the official buttons. On this article, we are going to present you the best way to add the official LinkedIn share button in WordPress.

Including Official LinkedIn Share Button in WordPress

For this tutorial you’ll must edit your WordPress theme information. For those who haven’t performed this earlier than, then try our information on the best way to copy and paste code in WordPress.

First, you have to go to the LinkedIn Share Plugin web page. You’ll be requested to pick out your web site’s language and the button fashion you need to use.

You’ll be able to depart the URL area clean as a result of the share button can mechanically get the web page URL.

Subsequent, you have to click on on the ‘Get Code’ button to repeat your LinkedIn share button code.

Now that we bought the share code, let’s add the official buttons in your WordPress website.

Show LinkedIn Share Button in WordPress Posts and Pages

If you wish to show the Linked-In share button earlier than your submit content material, then you should use the next code. You will have to repeat and paste this code into your theme’s features.php file or in a site-specific plugin.

1
2
3
4
5
6
7
8
function wpb_linkedin_share_before($content) {
// Share code you copied from LinkedIn goes here
$sharecode .= '<script src="//platform.linkedin.com/in.js" type="text/javascript"> lang: en_US</script>
<script type="IN/Share" data-counter="top"></script>';
$newcontent = $sharecode .$content;
return $newcontent;
}
add_filter('the_content', 'wpb_linkedin_share_before');

It can save you your adjustments and go to your web site to see it in motion.

If you wish to show the share button after your submit’s content material, then you’ll need so as to add the next code as a substitute.

1
2
3
4
5
6
7
function wpb_linkedin_share_after($content) {
$sharecode .= '<script src="//platform.linkedin.com/in.js" type="text/javascript"> lang: en_US</script>
<script type="IN/Share" data-counter="top"></script>';
$newcontent = $content . $sharecode;
return $newcontent;
}
add_filter('the_content', 'wpb_linkedin_share_after');

You can even add the LinkedIn share button code you copied earlier immediately right into a WordPress customized HTML widget. Merely go to Look » Widgets web page and add the ‘Customized HTML’ widget to a sidebar.

Subsequent, add your Linked-In Share button code contained in the customized HTML widget and click on on the save button to retailer your adjustments.

Now you can go to your web site to see it in motion.

You May Also Like : How to Track User Engagement in WordPress with Google Analytics

We hope this text helped you discover ways to simply add the official LinkedIn share button in WordPress. You may additionally need to see our listing of the finest LinkedIn plugins for WordPress.

If you liked this article, make sure to hit the bell for getting our latest updates and share this article with your friends in every social media platforms.

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

How to Signup for Godaddy Affiliate Program & Start Making Money

GoDaddy is likely one of the well-liked model names out there of area and web-hosting. They are well-liked for a numerous cause, and so they...

How To Start Selling Website on Flippa: A Beginner’s Guide To Success

If you may have been working on-line for lengthy and into Website flipping, Flippa is one identify that you need to have heard of. Flippa is a...

How to Fix Your Connection is Not Private Error (Site Owners Guide)

Are you seeing ‘Your connection is not private’ error in your WordPress web site? This is the error message you’ll see on Google Chrome. The...

How to Fix the WordPress White Page of Death (Step by Step)

The WordPress white page of dying is one of the most widespread WordPress errors. It can also be one of the most irritating ones as...

Recent Comments