How to Customize the Facebook Page Plugin for Websites ?

The old Like box for Facebook Pages has been deprecated and replaced with a new Page Plugin. If you have not manually upgraded the embed code for Like box on your website yet, no worries as Facebook has automatically migrated all the Like boxes using the old embed code to the new Page Plugin.

Unlike the previous Like box that carried too much Facebook branding, the new Facebook Page plugin is cleaner without any branding. You can now display the cover photo of your Facebook Page inside the Like box. You can also add a “Call to Action” button that will redirect people to your email newsletter or prompt them to install your mobile app and so on.
The other difference that you can now only display a single row of fan pictures inside the Page Plugin. Why does this matter? The pile shows profile pictures of mutual friends who have liked your Facebook Page and thus, when a casual visitor sees a familiar face inside that pile, it is likely to increase their interest in your website.
What you see here are a list of customization options now available inside the Facebook Page plugin. You can choose to have a simple Like box with just your logo and like button or you can have a complete box with cover photos as well.
Customizing this Facebook Page plugin is simple as detailed in the official documentation. For instance, if you would not like to show a cover photo, set the HTML5 data attribute data-hide-cover to false in the DIV tag. Setting data-show-facepile to false will hide the row of pictures.
Similarly, you can attach styles to the .fb-page class to customize the outer of the Facebook Plugin. For instance, if you like the steps style I use here with the Facebook box at labnol.org, this is the underlying CSS code.

  1. <div class="fb-page"

  2. data-href="https://www.facebook.com/bashirahmad280"

  3. data-small-header="false"

  4. data-hide-cover="false"

  5. data-show-facepile="true"

  6. data-show-posts="false">

  7. </div>

  8.  

  9. <div id="fb-root"></div>

  10.  

  11. <style>

  12.  

  13. .fb-page, .fb-page:before, .fb-page:after {

  14. border: 1px solid #ccc;

  15. }

  16.  

  17. .fb-page:before, .fb-page:after {

  18. content: "";

  19. position: absolute;

  20. bottom: -3px;

  21. left: 2px;

  22. right: 2px;

  23. height: 1px;

  24. border-top: none

  25. }


  26. .fb-page:after {

  27. left: 4px;

  28. right: 4px;

  29. bottom: -5px;

  30. box-shadow: 0 0 2px #ccc

  31. }

  32. </style>

  33.  

  34. <script>

  35. (function(d, s, id) {

  36. var js, fjs = d.getElementsByTagName(s)[0];

  37. if (d.getElementById(id)) return;

  38. js = d.createElement(s); js.id = id;

  39. js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.4";

  40. fjs.parentNode.insertBefore(js, fjs);

  41. }(document, 'script', 'facebook-jssdk'));

  42. </script>


Facebook Comments

Bashir Ahmad

BASHIR Ahmad IS THE STUDENT OF INFORMATION TECHNOLOGY، HE LOVES BLOGGING, DISCOVERING NEW AND WOUNDERFULL THINGS.

Leave a Reply

Your email address will not be published. Required fields are marked *

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.