Facebook like button doesn't show when using domain URL

624 Views Asked by At

On one of my clients websites Facebook like button doesn't show up when button URL parameter contains domain name.

Example here. The button in question is located in floating sharebar to the left of the posts and just above the tweet counter.

The code for button is:

<iframe src="http://www.facebook.com/plugins/like.php?href=[url]&layout=box_count&show_faces=false&width=60&action=like&colorscheme=light&height=45" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:45px; height:60px;" allowTransparency="true"></iframe>

The [url] is replaced by current page URL. I tested the [url] short-code and it works correctly.

I tried replacing [url] with specific URL of the posts, but it still doesn't show up.

If I enter any other URL in the button code that doesn't contain domain name ( theresesquared.com ), then button shows up and works correctly.

I am not really sure why this is happening. Could Facebook be blocking the domain name theresesquared.com? Is that possible? Or is there another explanation why the button doesn't seem to be working?

2

There are 2 best solutions below

0
On

I'm also seeing this problem with a client's domain. It occurs at the button creation here:

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

If you put the url Andrew above provided into the URL field (http://www.theresesquared.com) and tab/click off of the field, the button preview disappears. When you add a different domain (http://www.google.com, for example) the preview re-appears.

0
On

Sorry my original answer was wrong. It was confusing because it turns out the like button and the page would only show if I was logged into Facebook. That is because I had the page set only visible to New Zealand visitors.

You need to remove the country restriction in order for the like button to show when the user is not logged into Facebook.