Facebook comments and like count problem in blogger blogspot - Solved
Published by Aslam
After blogger started applying Country Redirection in blogs, it is being a problem that Facebook comments and likes are not working properly because each visitor gets different result depends on current blog address. for example, my blog address is http://aslamise.blogspot.com , and when i visit that blog, it becomes http://aslamise.blogspot.in , because i visit from India , this is called country specified redirection.
BUT, we can overcome this problem of Facebook comments or like count problem or any other problem which caused by the redirection, by setting data:blog canonical URL in Facebook plugins
The solution is to tweak your plugin's code and relace data:blog.Url with data:blog.canonicalUrl .
So that it will always point to .com version of your blog.
Here is the Facebook comment plugin code many blogger users,
<b:if cond='data:blog.pageType == "item"'>
<div class='fb-comments' data-num-posts='20' data-width='610px' expr:data-href='data:blog.Url'/>
</b:if>
Perfect one is below one.
<b:if cond='data:blog.pageType == "item"'>
<div class='fb-comments' data-num-posts='20' data-width='610px' expr:data-href='data:blog.canonicalUrl'/>
</b:if>
We Change the expr:data-href='data:blog.Url' to expr:data-href='data:blog.canonicalUrl'
Facebook like plugin also need this to Work perfectly in blogger blog.
Enjoy blogging. if you have any doubts , feel free to ask in comments.
Or
still the comment box doesn't appear in all blog posts
ReplyDelete