WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Facebook Feed Grabber

Allows you to display the feed of a public page or profile on your website. Requires that you create a Facebook Application.

  1. Upload facebook-feed-grabber/ to the /wp-content/plugins/ directory.
  2. Activate the plugin through the 'Plugins' menu in WordPress.
  3. Go to the Facebook Feed Grabber options page and enter your Facebook App Id and Secret. If don't have a Facebook App then head on over to the Facebook Developers App page and create one.
  4. Set your default page id and any other settings you wish to adjust.

Ways to Display the Feed

To display the default feed using the other default settings do any of the following.

  • Widget Visit the widgets area and add the Facebook Feed Grabber Widget where you wish to display the feed.
  • Shortcode Add the shortcode tag [fb_feed] to any page or post to display the feed from within that page/post.
  • PHP Direct Use Display a feed anywhere in your theme by adding <?php fb_feed() ?> where you wish the feed to be displayed.

Advanced Usage

If you need to display one or more feeds in different locations and you need to vary the settings for each instance this section is for you. Don't let the term "Advanced Usage" scare you.

The following are settings that can be changed for each feed you display. (Currently not available for the widgets)

  • cache_feed - int ~ The number of minutes to cache the feed for.

    Defaults to the value of "Cache Feed" from the plugin's options page.

  • container - string ~ The element to wrap the feed items in. If NULL then no container is used.

    Defaults to 'div'.

  • container_id - string ~ The ID of the container element. If left empty or contains 0 then no container ID will be set.

    Defaults to 'fb-feed'.

  • container_class - string ~ The class of the container element. If left empty or contains 0 then container class will be set.

    Defaults to 'fb-feed'.

  • limit - boolean ~ Whether to limit the feed to posts by the feed author. Pass 1 for true or 0 for false when using the [fb_feed] shortcode.

    Defaults to the value of "Limit to Posts From Feed" from the plugin's options page.

  • echo - boolean ~ Echo the results when true else it returns the results. Only works when calling fb_feed() in PHP.

    Defaults to true.

  • maxitems => $options['num_entries'] - int ~ Limits the number of entries displayed.

    Defaults to the value of "Number of Entries" from the plugin's options page.

  • show_title - boolean ~ Whether to show the Facebook page title before the feed. Pass 1 for true or 0 for false when using the [fb_feed] shortcode tag.

    Defaults to true.

Arguments can be passed to fb_feed($feed_id, $args) as an array in $args or as key=value pairs in the [fb_feed] shortcode tag. For examples keep reading.

Examples

To display the feed defined on the options page in a post or page without the page title use,

[fb_feed show_title=1]

To do the same in a template file use,

<?php fb_feed( null, array('show_title' => false) ); ?>

To display a feed not defined on the options page, change the max number of entries to show to 6 and change the container ID use the following,

[fb_feed container_id='facebook-feed' maxitems=6]101359869934470[/fb_feed]

To do the same in a template file use,

<?php fb_feed( '101359869934470', array('container_id' => 'facebook-feed', 'maxitems' => 6) ); ?>

If you are going to show more that one feed in a template file I suggest doing something like the following,

<?php
// Call the class to make the initial connection.
$facebook = new ffg();

// Display the first feed using all default settings
$facebook->feed();

// Display a second feed with the id 101359869934470. You should also change the id of the container for one of the feeds.
// If you use a different container id you can't use the more specefic second default stylesheet.
$facebook->feed('101359869934470', array('container_id'=>'fb-feed-2'));
?>

Requires: 3.3 or higher
Compatible up to: 3.8.3
Last Updated: 2013-12-14
Downloads: 29,196

Ratings

4 stars
4.1 out of 5 stars

Support

1 of 3 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

67,3,2
100,1,1
100,2,2
0,1,0
100,1,1
0,1,0
100,1,1 100,1,1 67,3,2
50,2,1
50,2,1