This quick article will show you how to include a LinkedIn 'Share Widget' into your WordPress post or page with shortcode. The small snippet of JavaScript the function returns is minimal, but shortcode is still the most efficient means of returning the same snippet of code or text in multiple locations. If LinkedIn were to alter their widget code, as they often do, you would only correct a single function to alter every occurrence of the widget code on your website.
The Result
The shortcode of [linkedinshare]
returns the following:
[linkedinshare align="right"]
. The result:
When aligning left or right you may also alter the padding around the widget. The share page and language may also be altered (as described below).
Shortcode Function
Copy and paste the WordPress function into your theme's functions.php
file or, if you sensibly have one installed, your custom functions plugin.
If you require shortcode to work in a sidebar widget, you'll have to enable the functionality with a filter. If you're using our custom functions plugin, you'll have that feature enabled by default.
Shortcode Attributes
The following shortcode attributes are available:
lang
url
[linkedinshare url="http://www.beliefmedia.com/"]
padding
padding
as required. If left as false, we'll simply center it.align
left
or right
. The widget will center by default.Download
Title: Add a LinkedIn Share Button To WordPress With Shortcode
Description: Add a LinkedIn share button To WordPress with shortcode. Attributes to alter the URL & styling.
Download • Version 0.1, 682.0B, zip, Category: WordPress Shortcodes