Easily integrate Facebook social plugins to your WordPress blog/site with simple template functions.
See below for full list of features, and how to use the plugin.
Features
- Auto Insertion of OpenGraph tags
- Like Button
- Send Button
- Comments Box
- Retrieve Facebook Comments
More Information
For more information, please read the Facebook documentations at
http://developers.facebook.com/docs/plugins/
Like Button
Display the Facebook Like button on any page.
Note: The Open Graph description tag will default to the site's Tagline if their is no excerpt.
To use, add
<?php fb_likebutton(); ?>
within the Loop.
Parameters
- $href (string) Defaults to the current post/page's permalink if not set
- $layout (string) Choices: 'standard', 'button_count', 'box_count'
- $width (integer) Width of the like button (in pixels)
- $colorscheme (string) Choices: 'light', 'dark'
- $action (string) Choices: 'like', 'recommend'
- $send (boolean) Include the send button?
Send Button
Display the Facebook Send button on any page.
Note: The Open Graph description tag will default to the site's Tagline if their is no excerpt.
To use, add
<?php fb_sendbutton(); ?>
within the Loop.
Parameters
- $href (string) Defaults to the current post/page's permalink if not set
- $font (string) Choices: 'arial', 'lucida grande', 'segoe ui', 'tahoma', 'trebuchet ms', 'verdana'
- $colorscheme (string) Choices: 'light', 'dark'
- $ref (string) A label for tracking referrals; must be less than 50 characters and can contain alphanumeric characters and some punctuation (currently +/=-.:_).
Comments
Display the Facebook comment box for the current page/post. To retrieve the comment count, please see Comment Count.
To use, add
<?php fb_comments(); ?>
within the Loop.
Parameters
- $xid (string) A unique identifier for the current object
- $width (integer) Width of the comment box (in pixels)
- $numposts (integer) Number of posts to display
- $migrated (boolean) True to display the new comment box, false to display the old comment box
- $reverse (boolean) Reverse the comments order (legacy only)
- $css (string) Location of the custom CSS for the comment box (legacy only)
Comment Count
Display the comment count for the current page/post.
To use, add
<?php fb_commentcount(); ?>
within the Loop.
Parameters
- $xid (string) A unique identifier for the current object
- $return (boolean) Return the raw count number (Default: false)
Get Comments
Retrieve all comments in a standard PHP object
To use, add
<?php fb_get_comments(); ?>
within the Loop.
Parameters
- $xid (string) A unique identifier for the current object
- $migrated (boolean) True to fetch results from the new comment box object, false to fetch from the legacy comment box
This plugin requires a Facebook API key. You can get one here:
http://developers.facebook.com/
- Upload the plugin folder to the /wp-content/plugins/ directory
- Activate the plugin through the Plugins menu in WordPress
- Go to Facebook Tools menu and fill out your Facebook application information with obtained from Facebook.
- Make sure your template is calling wp_head() and wp_footer() to allow loading of the Facebook API library.