Facebook like box shortcode plugin for WordPress


Facebook like box shortcode plugin for WordPress

Recently we released our 2 Facebook Widgets Facebook Contact Form and Facebook Messenger Button for WordPress website today we are going to launch our third Facebook widget for WordPress Facebook like box shortcode plugin Very Lightweight shortcode plugin.This is Our blog request post one of our blog reader asking this Fb like box shortcode widget.it will help us to save our time by adding simple shortcodes on our WordPress post’s, pages and sidebar for Displaying the Facebook Like Box.

Facebook like box shortcode

  • Build with Official Facebook Page Plugin tool
  • We convert this Facebook plugin as shortcode
  • it will help to reduce the plugin installation for adding Facebook like box to our WordPress posts and pages
  • just use the single shortcode for display the Facebook like box on your WordPress website

Installation

<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.6";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
  • Now add the Below PHP shortcode on your Theme’s funcation.php file
  • Go to Appearance > Editor

Learn How to add custom functionalities in WordPress theme

function facebooklikebox($atts) {
 extract( shortcode_atts( array(
), $atts ) );
return '<div class="fb-page" data-href="https://www.facebook.com/allwebtuts" data-small-header="true" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true"><div class="fb-xfbml-parse-ignore"></div></div>';
}
add_shortcode('myfacebook', 'facebooklikebox');
add_filter('widget_text', 'do_shortcode');
  • replace https://www.facebook.com/allwebtuts with your Facebook Page URL
  • That’s all Successfully we install FB Like box Shortcode Plugin on our WordPress website

How to use this?

usage of this plugin is very Simple Just use this Below shortcode on your post’s, page’s and sidebar

[myfacebook]

Customization

function facebooklikebox($atts) {
 extract( shortcode_atts( array(
), $atts ) );
return '<div class="fb-page" data-href="https://www.facebook.com/allwebtuts" data-small-header="true" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true"><div class="fb-xfbml-parse-ignore"></div></div>';
}
add_shortcode('myfacebook', 'facebooklikebox');
add_filter('widget_text', 'do_shortcode');
  • Replace the red Color Highlighted Page Plugin code with your Facebook page Plugin Code

If you Have Any Doubts Please Feel Free to comment Here our team will Help you.

 



Was this article helpful?
Thanks!

Your feedback helps us improve Allwebtuts.com