How to change facebook login button with my custom image?

The method which you are using is rendering login button from the Facebook Javascript code. However, you can write your own Javascript code function to mimic the functionality. Here is how to do it.

Up vote 0 down vote favorite share g+ share fb share tw.

My script has code like this echo '' . __("Login with Facebook", 'wdfb') . ''; Its using facebook's default login button plugin.

But I would like to use my custom facebook connect image. Can anyone help me? Facebook link|improve this question asked Mar 21 at 18:07user10915581617 100% accept rate.

The method which you are using is rendering login button from the Facebook Javascript code. However, you can write your own Javascript code function to mimic the functionality. Here is how to do it - 1) Create a simple anchor tag link with the image you want to show.

Have a onclick method on anchor tag which would actually do the real job. 2) Next, we create the Javascript function which will show the actual popup, and will fetch the complete user information, if user allows. We also handle the scenario if user disallows our facebook app.

Window. FbAsyncInit = function() { FB. Init({ appId : 'YOUR_APP_ID', oauth : true, status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); }; function fb_login(){ FB.

Login(function(response) { if (response. AuthResponse) { console. Log('Welcome!

Fetching your information.... '); //console. Log(response); // dump complete info access_token = response.authResponse. AccessToken; //get access token user_id = response.authResponse.

UserID; //get FB UID FB. Api('/me', function(response) { user_email = response. Email; //get user email // you can store this data into your database }); } else { //user hit cancel button console.

Log('User cancelled login or did not fully authorize. '); } }, { scope: 'publish_stream,email' }); } (function() { var e = document. CreateElement('script'); e.

Src = document.location. Protocol + '//connect.facebook.net/en_US/all.js'; e. Async = true; document.

GetElementById('fb-root'). AppendChild(e); }()); 3) We are done :) Please note that the above function is fully tested and works. You just need to put your facebook APP ID and it will work.

Do let me know if you have troubles running this code. Cheers! Sachin P.S. If someone can change the code into JS, it will be great.

Found a site on google explaining some changes, according to the author of the page fb does not allow custom buttons. Heres the website. Unfortunately, it’s against Facebook’s developer policies, which state: You must not circumvent our intended limitations on core Facebook features.

The Facebook Connect button is intended to be rendered in FBML, which means it’s only meant to look the way Facebook lets it.

– user1091558 Mar 21 at 18:21 If you look at the website I linked you will see that some modification is allowed, size font etc, but changing the image or so is not allowed. Read the website, you will understand better and even learn how to change it. – hustlerinc Mar 21 at 18:39 Obviously i've read that article you linked before posting my previous comment.

Here is the snapshot of mashable's custom facebook connect image. I'm sure they using custom image not the fbml code. This is their custom facebook image – user1091558 Mar 21 at 18:51 Their button is very similar to the normal fb button so it might be allowed, I don't know.

But the way they do it is just an image linking to the facebook login just like you would do any button link. They are not changing anything in the API. – hustlerinc Mar 21 at 18:55.

Found a site on google explaining some changes, according to the author of the page fb does not allow custom buttons. Heres the website.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions