Specify image dimensions Facebook LikeBox


Hi guys, do you have Facebook LikeBox in your website and when you use Google PageSpeed or Gtmetrix to optimize your Site’s Performance it tell you to Specify image dimensions for the like box profiles image (Dimensions: 50 x 50) Actually facebook loads your followers image at 50px X 50px but these dimensions are still absent from the code. This means that it will take longer to load your like box.

Like Bok Specify image dimensions

Well i found a solution to fix that first Get you Code from here: https://developers.facebook.com/docs/plugins/like-box-for-pages

now we are going to make some modification in the code

where there is class=”fb-like-box” add:

data-show-faces-width=”50″ data-show-faces-height=”50″

and that’s it ! here is the final code i get add it in any place in your website and it should solve the problem:

<div class=”fb-like-box” data-href=”https://www.facebook.com/4teqweb” data-width=”290″ data-height=”210″ data-show-faces-width=”50″ data-show-faces-height=”50″ data-colorscheme=”light” data-show-faces=”true” data-header=”true” data-stream=”false” data-show-border=”true”></div>

<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_US/sdk.js#xfbml=1&appId=405678272945787&version=v2.0”;
fjs.parentNode.insertBefore(js, fjs);
}(document, ‘script’, ‘facebook-jssdk’));</script>

You might also like More from author