I want to add facebook share button on my website, that should just post my website's content on the wall. who want to share it, i need to share link + title.
I have researched a lot but did not get anything. Pleas help me in this.
I have this code that suppose to work, but doesn't work. If this helps you in anyway that would be great.
i need for facebook, twitter, likein, google plus
<a target="_blank" href="http://www.linkedin.com/shareArticle?summary=&title=<?=$rowB['title'];?>&mini=true&url=<?php the_permalink(); ?>&ro=false&source=" class="string in"></a>
JS
function fb_shar()
{
var sharer = "http://www.facebook.com/sharer.php?u=";
window.open(sharer + encodeURIComponent(document.URL), 'facebook-share-dialog', 'width=626,height=436');
}
function pl_shar()
{
var sharer = "https://plus.google.com/share?url=";
window.open(sharer + document.URL, 'sharer', 'width=626,height=436');
}
i suggest you to use a plugin like Sharethis that's going to have all the options you gonna need and have many other options.
Why don't you use a Wordpress plugin. Like i.e. http://wordpress.org/plugins/sociable/
Related
Can anyone please explain how the addThis facebook like button works?
The code for adding the button is
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
I'm going through the code of a website with pages listing details of different products. There is this fb like button on each of those pages. What exactly is liked here? Since I don't provide any facebook URL which specifies the page or image or anything related to this product that I've already put on facebook, what is this like button liking?
I'm making Iframe app for Facebook's tab page. It has photos listing pulled from an Album.
Is there a way to show the native lightbox / popup for commenting. The one like shown in the picture below:
From the Graph API, I got the photo ID and all the data. Is there a way to initiate this event?
I can't seem to find the right term to Google it. I found an answer from 2011 saying it's impossible. Is it possible now?
As far as I have found, there's no way of doing this.
So, the simplest alternative is to open the photo in new browser tab.
Your link:
<a data-url="<?php echo $photo_url; ?>">
...
</a>
Javascript (using JQuery):
$("[data-url]").on("click", function(e) {
e.preventDefault();
var url = $(this).data("url");
window.open(url);
});
There's a quite a few products and services on this site I manage. They all have a Facebook share dialog. However, when clicking on the share button (for all of them), an empty Facebook dialog box appears:
My code is exactly what is given on the facebook site:
<a href="#"
onclick="
window.open(
'https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(location.href),
'facebook-share-dialog',
'width=626,height=436');
return false;">
Share on Facebook
</a>
Any ideas on what could be causing this?
Thanks to +phwd over in the #facebook freenode chatroom for the answer:
My link was wrong. I should have included this in my original post. Here's what I had before:
https://www.facebook.com/sharer/sharer.php?title&url=http%3A%2F%2Fwww.some_site.com%2Fsome_page
I needed to do 2 things to fix this:
Remove title
change url to u
So it comes out like this:
https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fwww.some_site.com%2Fsome_page
I want to share a link on facebook ,
Click to Share
Its working perfectly for web, but when I browse via any mobile(android,ios) it redirect to fb timeline but doesnot show/post anything .
<html>
Click here
<script>
function test(){
window.open("http://www.facebook.com/dialog/feed?app_id=YOURappID&link=linkToYourApps&caption=Watch%20our%20Ice%20Breaking%20Machine%20on%20You%20Tube%20%20%20%20%20Discover=yourComments&description=YourDescription&redirect_uri=redirect_url","_parent");
}
add this ?m2w parameter to sharer.php.
In your case:
http://www.facebook.com/sharer.php?m2w&s=100&p[url]=ENCODEDURL&p[title]=encoded TITLE&p[summary]=encoded description&p[images][0]=encoded
I have a ready facebook application that should be linked to a facebook page. I am trying to link the canvas url of my application to a button in the page with the help of javascript by calling:
function onBtnClick() { window.location = "http://apps.facebook.com/CANVAS_URL/"; }
When I click the button that is supposed to take me to the app I get only an empty page with a blue box and "Facebook" string inside it (pretty much looking like the facebook logo)
This box is a link to my application and if clicked takes me to http://apps.facebook.com/CANVAS_URL/
The same problem occurs in the application, where I try to link the facebook page. The link there is a regular <a> tag.
Do you have any ideas how to redirect to an app without this additional "Facebook" page?
Thanks in advance,
Martin
Use this instead:
top.location.href = "http://apps.facebook.com/CANVAS_URL/";
You need the upper frame (Facebook) to redirect.
If using a simple <a> html link, try target="_top"