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:
- How can I make add_image_size() crop from the top?
- Delete WordPress plugin Repository
- What is right way to go about adding functionality to a published WordPress plugin?
- Better to fire specific hooks or generic hooks with parameters?
- How to remove WPML Generator Meta Tag by theme’s functions.php (override plugin function)? [closed]
- Load plugin selectively for pages or posts, etc
- How do I sanitize a javascript text?
- Plugin for automatic database backup? [closed]
- How can a Firebase user registration and login be integrated into a WordPress site?
- Plugin for changing a post’s category based on it’s post date?
- WordPress Enqueue Script Chaos (jQuery & Foundation.js)
- check for the current screen
- Multisite functions to communicate with individual site functions
- Alter post slug by a filter that is fired just after a post is created
- I’m trying to create security question field for my login page
- How to show custom static content at top of each category page?
- How to show category images (from plugin) on a regular page (page-example.php)?
- WooCommerce “Save Changes” button appears inside custom settings
- Override the filter from plugin in child theme
- Sage WordPress – Plugin Namespace: Not Found
- Why is an action callback function from an instance of a class always invoking the same function from an instance?
- Dont’ charge customer until product ships – woocommerce [closed]
- register_activation_hook with include file [closed]
- Add htmlentities and/or shortcode into data-attributes
- Absolute Image URL in srcset is appended to the upload dir
- How can I capture Memberpress user info after signup [closed]
- WordPress Redirect Not Working – AJAX Callback Response Not Picked Up
- how to open page, defined in plugin, from dashboad widget
- WordPress independent plugin upgrade notification system [duplicate]
- Change upload folder for a CPT
- Is there an npm library that uses best practices to scaffold a wordpress plugin that is build with React?
- Using meta_query to get date type values from post_meta table WordPress
- How to allow an editor to edit all WordPress blog posts but have the last say as administrator?
- Add An Activity Filter By User Id In Buddypress Plugin
- Using plugin functions/methods within templates
- How to retain table data in wordpress phpunit tests
- Load plugins’.mo and .po files from a directory
- (Big issue) Blog is Getting Down Each day.. what should i do.?
- How to delete custom taxonomy terms in plugin’s uninstall.php?
- Ajax : Call undefined function plugin_function() … can’t call any plugin function
- change content based on url per plugin
- Setup wp_schedule_event within a custom plugin
- How to over-ride a file in a plugin? [closed]
- can i limit editing specific custom fields to certain roles?
- How to insert multiple postmeta values with one query?
- execute function after one completed
- How can I run a custom shortcode function on a live site and only run if the viewer is a specific machine?
- WHy custom plugin slows down the loading of the pages?
- What are the correct permissions so WP doesn’t ask for FTP credentials if installing plugin?
- Notice: Undefined index: mtral_field_subscriber
- Delete free version plugin will also delete premium plugin
- URL rewrite with external JSON query
- How to delete a theme using AJAX
- Adding a responsive grid onto a page (without using a Bootstrap theme) [closed]
- Class or function wrapper for plugin code
- Licensing a Plugin [closed]
- Add a function call after content automatically?
- Var_dump ACF “API”
- Shortcode Output on Top of the Posts [duplicate]
- Detect plugin/theme installation (via upload)
- Engadget Like Featured Breaking Plugin
- What is the most efficient way of adding additional functionaliy for admin only
- XML Sitemap Generator and 404 problem
- How do I work with the SlideDeck plug-in?
- Add hook after content without formatting
- Sold out Label for variable products which are partially sold out
- User loggedin as Subscriber form not sending
- admin_post hook not firing function inside class
- Merging new theme and plugins from development site to production
- .com creates automated link in post
- WordPress sitemap “Extra content at the end of the document”
- Unload a woff file from WordPress
- Crazy redirect happening with no redirects set up
- Title and date of last post stays on page even after replacing the_content
- Above the fold plugin error “The Proxy Cache directory contains n cache entries.”
- User / membership Plugin [closed]
- Can we validate data from jquery
- Fetching WP.me shortlinks for posts using WP Rest API
- How to display widget in front end?
- Shows warning when enable “wp_gallery_custom_links” plugin with Themify Builder
- show-hide based on select option jquery wordpress
- Where to store media uploaded by the plugin?
- error_log() not working in add_filter auto update callback
- Follow author on muti-user WordPress site
- Add a checkbox in plugin options page and make it actually work
- Integrating a hosted app with wordpress using the API
- wp_insert_post hook not being called with wp_publish_post or wp_insert_post?
- Calling a function from a link in WordPress
- WP_Query Date Filtering Inclusive Being Ignored
- Live coding in WordPress
- is_plugin_active() not defined on active plugin, in the thumbnails.php file
- wordpress plugin | short code issue
- WordPress site keeps getting flagged as malware [closed]
- Looking for a home page carousel [closed]
- Sell “create a post”, paid account for post creation
- How to remove site name (https://exp.com/) from WORDPRESS site source links or file load url
- Update title field while listing wordpress page titles in Elementor selector
- How to customized post slider layout in elementor wordpress [closed]
- I’m getting the following error: Fatal error: Uncaught Error: Call to undefined function oil_paint_regeneration() [closed]
- Selectively override Easy Digital Downloads protection via filter