I have the Facebook like button on my site http://theganjagirls.com ... everything looks and works fine when I\'m logged into my Facebook account... But when I\'m logged in as a
You could use a little script to set a timeout function and check the width of the widget
var timer;
$(window).load(function () {
window.clearTimeout(timer);
timer = window.setTimeout(function () {
if ($('.fb-like').width() === 0) {
$('.fb-like').hide();
console.log('face');
}
}, 1000); // using 1000 milliseconds to work around load race
});
Working Example
Be aware you may run into a load-race. If the script runs before the widget loads this method may fail...
I don't believe you can do that. Unless Facebook has made code for it, You can't just check for yourself.
Please remember that if you put in the default code for a Facebook like button, it will respond appropriately if the user is logged in.
Good luck!
put the icons in a container and apply the following css:
<style>.social-container{width:1px;height:1px;overflow:hidden}</style>
Wouldn't this: https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/ (for getting the logged in status) combined with this: Facebook: get list of pages that a user is admin of (for getting the pages the user is admin of) be solution to your problem?