The code below is placed in the header and called via php to every page of the website. (It's WordPress.)
The counter shows the like counts for the home page on every article. Any way to make it show the count for individual articles? (this is the site)
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1">
</script><fb:like href="http://GlamourUnderground.com" send="true" layout="box_count" width="55" show_faces="false" font="arial"></fb:like>
</div>
Thank you,
Tara
You have to put the permalink to the actual article in the <fb:like> tag, not just the home page.Try...
<fb:like
href="<?php the_permalink()?>"
send="true"
layout="box_count"
width="55" show_faces="false" font="arial"></fb:like>
This will work whenever you've called the_post(), e.g. on individual posts and pages and when you are in the "loop".
Related
I've implemented a Facebook Like plugin on a XHTML website (can't update the doctype to html5).
Say each "post" have a Like button.
I want to create a page with a selection of "posts" and each one will have a Like button.
2 questions:
Is it possible to share the information of a post when a user clic on a like in this page?
Obviously, I can't use the open graph meta data because it's page related, not post related.
I would like the title, the photo and a short description shared on the facebook user account.
Is it possible to know/retrieve the list of Facebook users who "liked" a particular "post"?
Edit: The answer is no.
Thank you for your answers or advices !
If I understand correctly the question is how to add like button for individual articles into a page which has a list of multiple articles.
Use the URL of the individual blog entry in the Like button code. For example if using HTML5 version of Like button then something like:
<div class="fb-like" data-href="http://www.example.com/blog/1" data-send="false" data-width="450" data-show-faces="false"></div>
<div class="fb-like" data-href="http://www.example.com/blog/2" data-send="false" data-width="450" data-show-faces="false"></div>
Or if using XFMBL version then:
<fb:like href="http://www.example.com/blog/1" send="false" width="450" show_faces="false"></fb:like>
<fb:like href="http://www.example.com/blog/2" send="false" width="450" show_faces="false"></fb:like>
I'm wondering if it is possible to synchronize the likes between the like button on your actual page & the likes you get on facebook itself!?
For example..... we currently have 15 likes on FB but the AddThis widget on our website only shows 1 like.
So I'm wondering, is there a way you can synchronize the two either with AddThis or ShareThis; doesn't matter the platform, just would prefer it to be synchronized.
I take it if you grab the code from facebook itself rather then use these services then it will be synchronized?
If you specifically point your like URL fb:like:href="THE URL" to your Facebook page when you call the AddThis like button it should be in sync with the likes there.
Like so:
<a class="addthis_button_facebook_like" fb:like:href="THE URL TO YOUR FACEBOOK PAGE"></a>
For example:
<a class="addthis_button_facebook_like" fb:like:href="http://www.facebook.com/nike"></a>
Because you reference FB Social Plugins in your tags, I can confirm that this is definitly the case for Facebook's own like button.
<div class="fb-like" data-send="false" data-layout="standard" data-width="450" data-show-faces="false" data-colorscheme="light" data-action="like" data-href="http://www.nike.com/"></div>
gives the likes for that site. And:
<div class="fb-like" data-send="false" data-layout="standard" data-width="450" data-show-faces="false" data-colorscheme="light" data-action="like" data-href="http://www.facebook.com/nike"></div>
Gives the likes displaying for their FB page.
I believe the issue there is a misunderstanding of the platforms or possible confusion with semantics. Someone can 'like' content on your website via a widget which will share that like to their Facebook profile. Additionally, you can display the amount of likes your website's page has with a Facebook widget or AddThis widget.
However, if you share a page from your website's Facebook page and users can like that, however that will not increment the displayed likes in the widgets aforementioned. Hopefully that clears it up?
I have this code for a Facebook custom share button:
<script>
function fbs_click() {
u=location.href;
t=document.title;
window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
return false;
}
</script>
<a rel="nofollow" href="http://www.facebook.com/share.php?u=<;url>" onclick="return fbs_click()" target="_blank" class="fb_share_link">
<img src="../../../../../image/photography/pics/fb-share.png" alt="Share this!" width="57" height="21" border="0">
</a>
This is supposed to scrape info from the page but for some reason it doesn't and it gets redirected to the site's main index.html.
I've tried adding facebook og tags and the extra code in the but to no avail.
Any thoughts?
EDIT: Having been told that the share function has been deprecated, I tried to do this with the feed dialog:
<a href="https://www.facebook.com/dialog/feed?link=http://www.travel2italy.com/Travel/Italy/Company/photography/index.html&picture=http://www.travel2italy.com/image/photography/pics/homepage/florence1-home.jpg&name=travel2italy.com&caption=Photo%20Gallery&description=A%20Beautiful%20photo%20of%20Florence&redirect_uri=http://www.travelive.com" target="_blank">
<img src="../../../../../image/photography/pics/fb-share.png" alt="Tweet this!" width="57" height="21" border="0">
</a>
but when i click on the link it takes me to facebook and says an error occured, wth?!:(
EDIT 2:
I wasn't aware that the app_id argument is needed, signed up for an app and it works now, but it strips away the #section I have at the end of the link (i want it to link to a specific slide in a slideshow)
EDIT 3:
Now some of the share buttons using the sharer do seem to work but don't pull all the photos off the page for me to choose the one i want, this is insane-o, could it just be a caching issue?
I have a website with a news section, and I want to put individual "like" buttons in each post. The problem is that the buttons shows the root like count and not the count of that specific page/post.
And the weirdest is that it works in one of the pages, but not in the others.
This is the page with the buttons working and this is one of the pages where te button isn't working.
I've already read all the content of facebook's social plugin and open graph, and I still don't understand what's happening.
This button don't work:
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=218284238205675&xfbml=1"></script><fb:like href="http://eepolitecnica.org.br/noticias/valor_poli_cria_primeiro_fundo_de_universidade/" send="true" layout="button_count" width="150" show_faces="false" font=""></fb:like>
and this works fine:
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=170199966377672&xfbml=1"></script><fb:like href="http://eepolitecnica.org.br/noticias/jornal_nacional_exibe_materia_sobre_o_eep" send="true" layout="button_count" width="150" show_faces="false" font=""></fb:like>
These are some relevant meta tags I have
<meta property="og:type" content="article" />
<meta property="og:url" content="<?php echo $base_url, $site_url; ?>" />
Is that a common bug from FB's Like button as it seems or I'm really doing something wrong?
Sorry about my terrible english...
Remove the trailing slash in the version that doesn't work. This trailing slash is causing your urls not to match and so facebook is defaulting back to the base url
eg:
<fb:like href="http://eepolitecnica.org.br/noticias/valor_poli_cria_primeiro_fundo_de_universidade" send="true" layout="button_count" width="150" show_faces="false" font=""></fb:like>
Try using FB's linter tool: https://developers.facebook.com/tools/lint/
Enter the URL for your different pages and see what FB is actually seeing from the XFBML tags on your page. This might shed more light or post back results here.
Try this
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<fb:like href="http://www.facebook.com/account-name" send="true" layout="button_count" width="150" show_faces="false" font=""></fb:like>
I am trying to use AddThis button on a web page of mine, which you can share, like (facebook), and tweet (twitter) -
the AddThis code is pretty straight forward below,
<!-- AddThis Button BEGIN -->
<div id="share" class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_counter addthis_pill_style"></a><!---->
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4cdb5be51dc49c98"></script>
<!-- AddThis Button END -->
but I don't understand - in the code above, where can I put the image or video url which I have uploaded and posted on my fb page? for instance the url below is the image from my facebook page that I want to track how many people like this picture through my website,
http://www.facebook.com/photo.php?fbid=10150115644909972&set=a.10150115644754972.329183.55239684971
I have read through the documentation on AddThis but it doesnt explain this at all!
http://www.addthis.com/help/client-api#configuration-sharing
It points me to this,
http://developers.facebook.com/docs/reference/plugins/like#
again, this is a Facebook plugin, no used within AddThis. If I am using the Like button from the Facebook API, then I cannot use the AddThis plugin above, can I?
furthermore, The Like button from Faebook API seems to work on the Facebook page, but not an individual picture or video I uploaded/ posted on my Facebook Page, for instance, I tried this on my localhost, the picture on my Facebook Page won't collect the number of likes even though I have clicked the Like button on my screen.
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http://www.facebook.com/photo.php?fbid=10150115644909972&set=a.10150115644754972.329183.55239684971" layout="button_count" font="arial"></fb:like>
so my main doubt on the Like button itself - does it work on facebook only or does it apply to the individual picture/ video on my facebook page? I tried to find this answer from the facebook Like documentation but it doesn't explain anything about this.
it would be grateful if you have any idea. thanks!
Try this:
...
<div class="addthis_toolbox addthis_default_style"
expr:addthis:title='Photo'
expr:addthis:url='http://www.facebook.com/photo.php?fbid=10150115644909972&set=a.10150115644754972.329183.55239684971'>
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_counter addthis_pill_style"></a><!---->
</div>
...
See also: http://www.addthis.com/help/widget-sharing#tagging
You might get an error with the add this way to display the Facebook Like Button and IIS7.0.
I had the problem yesterday and have posted a solution here.
Hope this helps,
Covo