Skip to content

Instantly share code, notes, and snippets.

@JudeRosario
Created August 23, 2015 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JudeRosario/2bf0d606da7ed9f6f04f to your computer and use it in GitHub Desktop.
Save JudeRosario/2bf0d606da7ed9f6f04f to your computer and use it in GitHub Desktop.
Ultimate FaceBook - Shortcode for inline comments
add_shortcode('ufb_comments_box','ufb_comments_box_handler');
function ufb_comments_box_handler( $atts ) {
ob_start();
do_action('fb_comments');
$fb_shortcode = ob_get_contents();
ob_end_clean();
return $fb_output;
}
@JudeRosario
Copy link
Author

Usage

Simply put [ufb_comments_box] anywhere in your page/post/widget to get a Facebook comments box.

Setup

Just copy/paste the code into the functions.php file of your child theme or a site specific plugin if you use one.

Then set the custom hook in the Dashboard under FaceBook Settings > Use a custom hook option, as shown in the screenshot below

Usage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment