You can use this library located at Github.
<?php
require './facebook.php';
$facebook = new Facebook(array(
'appId' => 'YOUR APP ID',
'secret' => 'YOUR API SECRET',
'cookie' => true, // enable optional cookie support
));
if ($facebook->getSession()) {
PLACE YOUR WP LOOP HERE
} else {
echo '<a href="' . $facebook->getLoginUrl() . '">Login</a>';
ADD YOUR APP's 'Connect' button here.
}
?>
Include facebook.php from the library located at Github (2nd line).
Related Posts:
- Remove action from plugin on other plugin
- WordPress Plugin Development In MVC Architecture, How?
- How to build an API as a plugin
- What happens when two plugins have the same 3rd party class included into them?
- Update Multiple Post Meta for the Same Post In One call?
- Allowing Custom Capability to Manage Plugin Options
- Create custom column in post table in wordpress
- Add .html extension to custom post type taxonomies
- How to load a new template page according to a particular URL?
- Styles and Scripts, Selectively enqueue across entire site
- Exclude custom post_type in sitemap generation?
- The plugin generated x characters of unexpected output, $wpdb not defined
- Override the core function locate_template
- Admin page: form with enctype=”multipart/form-data” does not transfer its data
- Use oEmbed in List Items
- Trigger renewal order emails for WooCommerce subscriptions for testing
- How Can I Pass the Shortcode’s $atts Variable to the Plugin’s Javascript Function
- Set user ID at time of wp_create_user
- Reset WordPress website
- WordPress Ajax Callback
- Portfolio + Blog: multisite or plugin?
- Building a store locator with google maps
- Runng Cron Job for Plugin With No CronTab Access
- add_menu_page does not seem to work in a class
- Form isn’t inserting data into database with ajax plugin
- WordPress CodeHighlighter
- How would I go about creating a user ranked post popularity page?
- All of my custom posttypes are 404’ing
- WordPress: PHP code rendering in the wrong place
- New to wordpress, Question about editing PHP
- ‘No Results Found’ on single post for custom post type
- Exporting post content from wordpress using WP All Export and wpautop() php function to include paragraph tags
- How to remove the inline styles from the content of a WYSIWYG editor field at the time of saving the post?
- How can I change the plugin update server for specific plugins?
- How to create an input field, and base the output on spreadsheet data? [closed]
- Blacklist IP After Using WordPress Plugin Detector?
- WordPress plugin subscribe2 not looking the same as before migration
- Admin style for just one plugin in dashboard
- Trouble adding tiny mce to textarea in custom plugin
- Js file is not adding using this code in functions.php
- How to pass variables to a function argument using add_action [duplicate]
- Identifying where plugins are being used in your wordpress install
- Activate my plugins via FTP
- How to check if my wordpress websiste is nulled or not?
- update_option_{$option} not showing old value
- How to get the particular product quantity in orders in Woocommerce [closed]
- Tutor LMS problem with Paid Memberships Pro [closed]
- A server-side hook failed when committing plugin code to SVN
- Update WP option by plugin
- plugin enqueue style on all pages
- File Uploader – Upload without adding to Media Library
- Trying to include files in plugin isn’t working
- Table appears in Visual mode of editor but not in preview or after publish
- Do WordPress plugins suport multisite site?
- A plugin popularity data inside “install new plugin” [closed]
- Error jQuery(domChunk).live is not a function
- I cannot include a file in my plugin settings page
- AJAX call inside plugin class is not getting to it’s response function
- force logged in user to stay in the dashboard
- Clicking custom plugin admin menu redirects to “No Update Required” on live site
- Creating an array from form inputs before it is posted to the options database
- How to assign a specific service to a specific provider based on location
- The plugin generated 227 characters of unexpected output during activation. If you notice “headers already sent” messages
- How to add the google ad conversion tracking code into the thank you page
- Custom Taxonomy is Missing (Or Limiting) Items
- How can I disable W3 Total Cache Image Lazy Load for Specific Post Type?
- How can I pull in the most recent blog posts to a section with Elementor Page Builder?
- Point Python path in WordPress
- User updating their profile wipes my custom fields
- Migrations for plugins, page and theme: looking for a good approach
- How can I add a permissions callback to the REST API index pages?
- ERROR message: “The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.”
- Installation failed, trying to install ANY plugin
- Memberpress: Can I add a second email address?
- Cannot modify header information – headers already sent during plugin activation
- How can I make the search bar in my wordpress site search all of the pages rather than just the blog posts?
- After form submission want to show success message in the form page
- Help Code Review – I need to write on .htaccess file from theme’s function.php
- Render Shortcode in Lightbox Gallery
- How to insert image into the Settings Page of a Plugin?
- How to force regenerate thumbnails in WordPress posts?
- change product image url in widgets & shop page
- dummy category, include .php file
- Hide some portion on single.php base on author
- Multiple Plugins Interacting with Menu
- Plugin constructor called multiple times
- How to add a handler for a button in plugin?
- Custom Form only for admin
- how to call jQuery in admin as well as in homepage
- How to programmatically detect how many posts are displayed per page?
- wordpress last all added get meta value by post id
- Is a custom post type considred a plugin?
- Migrate DB Plugin: Error “The directory needs to be writable”
- Woocommerce disable checkout on specific day
- How to delete Password Protected posts cookies when a user logged out from the site
- How to debug periodic performance issue
- wp_options Table keeps growing
- Run a function only once when logging into dashboard
- Stop the user if login from the cookies
- Randomly display activity posts on home page with buddypress