Add To Facebook Plugin
I was browsing through some articles in my RSS reader when I realized that some of the articles had links on them that would add the article to the viewers Facebook account. I thought that it would be a nice idea to add this functionality to my WordPress blog so I searched for a plugin that would do this. Unfortunately I couldn’t find one. Fortunately I knew how to write one myself.
I bring you the Add To Facebook plugin. This plugin adds a link to the bottom of each post and page on your blog with the text “Share on Facebook” or the Facebook icon or both depending on what you choose on the Options page. Alternately you can add the link anywhere within your theme using a template tag.
Compatibility
This plugin is not compatible with WordPress 2.9+. Please use Share on Facebook for compatibility with WordPress 2.9+.
Installation Instructions
- Add a directory called ‘add-to-facebook-plugin’ (without the quotes) to your ‘/wp-content/plugins/’ directory.
- Upload addtofacebook.php and facebook_share_icon.gif to the ‘/wp-content/plugins/addtofacebook/’ directory.
- Activate the plugin from your admin interface.
- Go to ‘Options->Add to Facebook’ in your admin interface to select you options.
CSS
The CSS for this plugin is found in the included facebook.css file. This file may be edited to change the style of the link.
Options
There are two options on the options page: Link Type and Insertion Type.
- Link Type – This option sets if you want your Facebook link to be text, image or both.
- Insertion Type – This option sets how you want to insert the link into your posts/pages. There are two choices: auto or template.
- Auto – When insertion type is set to auto the Facebook link will automatically be inserted right after the post.
- Template – When insertion type is set to template the Facebook link will appear wherever the template tag for the plugin is added to your theme. This option requires the following template tag to be added to your theme:
< ?php if(function_exists(addtofacebook)) : addtofacebook(); endif; ?>
Once this option is set the link will be added either to the end of every post/page on your blog or wherever you add the template tag in your theme. When clicked the user will be brought to the Facebook login page and, after they log in, the article will be added to the Mini-Feed section of their profile.
Download Current Version
Add To Facebook Plugin 1.4.3
Changelog
* 1.4.3 – Improved option saving mechanism to avoid conflicts with other plugins.
* 1.4.2 – Added a title specs to the links.
* 1.4.1 – Added slashes at end of image tags per XHTML specification.
* 1.4 – Added CSS.
– Fixed bug that prevented the Facebook icon to appear in version 1.3.
* v1.3 – Links now open in a new tab/window.
* v1.2 – Added option to use a template tag.
– Fixed bug that prevented the Facebook icon to appear in version 1.1.
* v1.1 – Added Options page for user to choose to use text, image or both for the link.
* v1.0 – Initial public release.
Support
If you have any questions, comment or suggestions please leave them in a comment or email them to me.
Donations
If you find this plugin useful please feel free to donate a little money to help me offset the costs of this website. Thanks.