Jon
Jon

Reputation: 8521

How to Modify Facebook Like to Look Like This

I am trying to implement the Facebook Like button on my website, but am having problems customizing the look of it. I have been using the Facebook Like Button Generator and I thought changing the Layout Style to Button_Count would have solved my problem, but it didn't seem to change the appearance in any way.

Code the generator spits out:

<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/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="fb-like" data-href="http://www.google.ca" data-send="true" data-width="450" data-show-faces="true"></div>

I am more concerned about the text to the right of the Like button. Currently, the text on the right is too long for my website. I am wondering if there is an alternative so I can shorten the text to just show how many likes I have?

enter image description here

Upvotes: 0

Views: 166

Answers (1)

indy
indy

Reputation: 391

Add the data-layout="button_count" attribute to the button element because it seems to be missing. This will render the more compact version of the button.

Source: https://developers.facebook.com/docs/reference/plugins/like/

Upvotes: 2

Related Questions