Skip to content

Instantly share code, notes, and snippets.

@johnantoni
Created March 7, 2012 23:04
Show Gist options
  • Save johnantoni/1997008 to your computer and use it in GitHub Desktop.
Save johnantoni/1997008 to your computer and use it in GitHub Desktop.
Facebook like hack to hide the like count
.fb_like #fb
width: 48px
.fb_edge_widget_with_comment iframe
width: 48px !important
.fb_edge_comment_widget
&.fb_iframe_widget iframe
width: 401px !important
@johnantoni
Copy link
Author

http://facebook.stackoverflow.com/questions/2950172/facebook-like-button-hide-count

basically create a div containing the like button ("#fb") then set it's width to 48px, don't use overflow:hidden as the comment box will be cut in half when they like it.

then assign the extra classes on liking

@edgyveggie
Copy link

Hi johnantoni,

Thank you for providing the Facebook hack to hide the "like" count. However, as a newbie, I'm a little confused as to how to exactly implement the coding in which you provided. I've seen a lot of tips online, but they all seem to be outdated. I would greatly appreciate any feedback that you can offer. Thank you, in advance.

Below is a link to the full coding that I implemented on my client's site (which is a static site, built in PHP), including the JavaScript SDK and the plugin code (I used the HTML5 version; and as for the specs, I unchecked the "send button," selected the "button_count" layout style, unchecked "show faces," and the verb is "like"):

https://gist.github.com/edgyveggie/a0b1de092675ee58a0c6

@bodomalo
Copy link

Hi

This whole thing is not working perfectly. Think FB has changed something with their button code again.
Also noscript function "clearclick" gives a Hijack Warning because of the visible content behind the button...

@dandv
Copy link

dandv commented Jun 29, 2015

This is no longer necessary - just use the "button" layout - https://developers.facebook.com/docs/plugins/like-button

Also, it's against the FB terms to obscure elements of the social plugins: https://developers.facebook.com/policy/, 13.4.

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