Description
This plugin provides a function to output links to share a post to Facebook, Twitter, and Google+.
Selected themes by Ruven will display the links automatically when the plugin is activated.
In other themes you will have to edit the templates in your theme in order to output the links.
Here an example of outputting the links in as list:
<?php
if(function_exists('ruven_sharing_links')) {
echo '<ul class="sharing-list">';
$sharing_links = ruven_sharing_links();
foreach($sharing_links as $sharing_link) {
echo "<li>$sharing_link</li>";
}
echo '</ul>';
}
?>
Usage
$sharing_links = ruven_sharing_links( $get_array, $include, $open_in_new_tab, $class );
Parameters
$get_array
(bool) (optional) If you want the return value to be an associative array (title, URL) or an array of HTML links. By getting an associative array, you are able to customize the output more.
Default: false
$include
(array) (optional) If you don’t want all platforms (Facebook, Twitter, and Google+) included, you can specify here which you want specifically to be returned. E.g. array('Twitter', 'Facebook')
would only return Twitter and Facebook links.
Default: array()
$open_in_new_tab
(bool) (optional) If you want the sharing dialog to be opened in a new tab/window or not.
Default: true
$class
(array) (optional) Classes you want to add to the links. E.g. array('sharing-button', 'big-button')
Default: array()
Return Value
If the value of $get_array
is false
(default), the function returns an array of HTML links.
If the value of $get_array
is true
, the function returns an associative array of the title (e.g. “Twitter”) and the URL to share the post.
Installation
This plugin can be installed directly from your site.
- Log in and navigate to Plugins → Add New.
- Type “Ruven Themes: Sharing Links” into the Search input and click the “Search Plugins” button.
- Locate the Ruven Themes: Sharing Links in the list of search results and click “Install Now”.
- Click the “Activate Plugin” link at the bottom of the install screen.
It can also be installed manually.
- Download the “Ruven Themes: Sharing Links” plugin from WordPress.org.
- Unzip the package and move it into your plugins directory.
- Log into WordPress and navigate to the “Plugins” screen.
- Locate “Ruven Themes: Sharing Links” in the list and click the “Activate” link.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“Ruven Themes: Sharing Links” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Ruven Themes: Sharing Links” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
v1.1
- Minor code improvements.
v1.0
- Initial Release.