top of page
juncpenacounsamons

The Ultimate Resource for the Script for Like Button in Facebook



I have used this several times myself, and with a little digging around in the Facebook code you can attach hover events and everything else to make it look like a custom button. You would have to find what elements to set opacity : 0 on.




script for like button in facebook



When you create a html element with fb-like class, facebook javascript SDK convert it with a like button when document loaded. You can make a custom element and trigger click event of like button when user click your custom button.


If you do want to do this legitimately, you will need to create an app and have the user authorise the app when he visits your site. This will open a popup where the user agreed to let the app access his FB account. Once that is done you can then send the like request on behalf of the user via a server-side script. In other words, it's not worth the effort.


I think that facebook goes through great lengths to make sure people can't trigger the "Like" button. This is to prevent scripts from automatically clicking the "Like" button when someone visits the site.


I can't figure out how to solve this one. Also, because of the volume of FB like buttons, it is a little slower on my dev build, so delaying the display:none until end of page load won't work either.


I've noticed that the difference between hidden and unhidden container, that is, removing my 'hide' class from div#fb_like_button, the and that facebook places inside div.fb-like changes style attributes width and height.


No solution yet, but I'll keep updating as I find more info. I'm going to try very hard not to add additional javascript that sets these style attributes back, but rather decode wtf facebook is doing. Just hope this helps someone.


I was wondering, I wish to have a landing page with Facebook's Open Graph (specifically the like button) and I wanted to basically have content set to display:none (can't remember the specific until a user likes a page. An example being a div on an e-commerce store that when a user likes the page, the div is set to display:block and users can redeem a coupon code for discount.


Use this button to encourage website visitors to communicate with you via Twitter. Add this button to pages on your site like your 'Contact Us,' 'About Us,' or 'Help' pages. It's great for customer support.


There may be times when you prefer to use an anchor text share link over a button. These links are easy to create and can be added to web pages, blog articles, landing pages, or within content like ebooks and whitepapers.


To create and install this button, visit -us/linkedin/consumer/integrations/self-serve/plugins/share-plugin, and copy the HTML code. Then, swap out the data-url=" " with whichever URL you'd like visitors to share, i.e. the blog post visitors are reading or the web page they've landed on.


To create a YouTube Subscribe Button, visit _subscribe_button, enter the name of your company's YouTube channel, select a button size and color theme, decide whether you want to display your logo, and decide whether you want to display your follower count shown or hidden. Then, copy and paste the code onto your website where you'd like the button to appear.


Hi Antonio, I have taken a look at your website.The like button described in this snippet was not intended to behave like this, and it did not by the time the snippet was published.This issue requires some CSS coding. May some javascript. You might want to post a new thread in the support forum of the theme : You will get a wider audience there.Thanks


To set the width of your like button, simply put the number of pixels wide you would prefer the like button to be.You are able to adjust the layout, the size, and the action type ("Like" or "Recommend") of your button. You can include a share button and profile pictures of friends who already like the page.


In most cases, both for Like and Share buttons, using the default code that Facebook provides would be the simplest and sometimes the best option. For example, if you don't want to get involved with coding and styling your own buttons, or if you want to display the buttons exactly as they appear on Facebook's button generator preview, or if you want to keep displaying the numeric like and share values, my suggestion would be to go with the code that Facebook's Share Button Configurator generates.


Like layout and design, page loading speed is an important factor while serving your website pages to your visitors and sometimes third party scripts such as the script that is used in the default Facebook share button code may slow down the overall loading of your website. Sometimes, even if it doesn't directly slow down your website, after all other elements on your page has finished loading, the external scripts may continue to load and keep the browser busy unnecessarily due to some momentarily connection issues with the server where that script is hosted, in this case the Facebook site.


I did a quick check and noticed that the size of the script that Facebook uses for the Share button is 171 KB. This may not sound much for some of you but in terms of JavaScript standards, this is a huge file. If you wouldn't want to add a huge file to your website just to do a simple task which is to let your visitors share your pages on their Facebook profiles, hence increase your page's loading speed, especially concerning the mobile Internet users, then creating a custom Share button is the way to go.


All of the below snippets has href field as which takes the url of the current page, this is useful when you want to have like button on all the posts or pages. you can simply add any of the below button code in your theme template such as single.php etc and the code will itself fetch the url of the current page/post.


Paste the script after opening of tag and before closing of it (). Mention the button code at the place where you want the like button to be rendered. Include it in single.php file in order to make it display only on posts.


The above tags are nothing but facebook open graph meta tags, which helps Facebook to understand your content. Since, all of the required information has been provided to Facebook in the form of these meta tags, the Facebook like button and Facebook share actions are entirely different than, the normal webpage with no open graph tags. It basically improves the sharing and fblike experience.


Let us know if you face any difficulty while setting up the above code for adding Facebook like button to your website. Also, do let us know if you find any bug or issue with any of the above mentioned codes/scripts.


Hi, all.I am using Blog Bank WordPress theme which has nicely built Facebook, Twitter, Google+ and LinkedIn buttons but I cannot seem to make them work as intended (refer to my respective social sites). I would like to know if there is a way to do it.Thank you for the continual great work you are doing for us, beginners.


Have set up a personal web site (not for profit) rather then a blog using WordPress. Very impressed that I was able to do it with my very limited web knowledge. Would like to add a Facebook like button but your instructions do not work for my home page?Thanks Len


I was wondering if you could tell me how to customize the image and description that shows on Facebook when you like the site or possibly point me to a article that discusses this, I am having the hardest time trying to figure that part out. Thanks!


Hi, I posted the code on my site and it worked. However, the friend icon is not staying. When i refresh the page, the friend icon disappears. I want all of the friend that clicked the like button to remain so I would know who clicked the like button. I need their names for the prize drawing. Can you help? Here is my code:


@jenniferdoser Ok first, you need to follow the XFBML way if you want insights, and the dropdown message box on the like buttons.Then follow this tutorial: -tutorials/how-to-get-facebook-insights-for-your-wordpress-site/


Facebook does not need to use third-party cookies to track you as you move from site to site, if the sites contain Facebook's javascript code (e.g. for the Facebook 'like' button). In this case, Facebook's javascript code can place first-party cookies on your system, and communicate back to Facebook's servers to show you ads based on sites that you've visited previously.


You can learn more about this from Facebook's B2B Marketing page and their Developer Documentation. Note that even if you block Javascript and third party cookies, there is still a no-script tag which loads an image (tracking pixel) which will leak some information to facebook's servers. This is why you need a browser plugin which has blacklists in order to truly browse privately.


Important:These buttons work with javascript so you will not be able to share content with these buttons from a standard email template. You must use an online hosted version of your email, with the correct javascript embedded to enable people to share your email content on Facebook and Twitter.


By default FacebookProvider is loading facebook script immediately after render (you are able to use it with SSR).If you want to download facebook script only when facebook component is rendered you need to add parameter lazy to FacebookProvider.Use only one instance of the FacebookProvider on your page.


Users can still respond to a post or comment with the traditional "like" button. But starting Wednesday, holding down the "like" button on mobile or hovering over the icon on desktop, gives users an expanded menu allowing them to choose from six different animated emoji "Reactions": Like, Love, Haha, Wow Sad or Angry. "Reactions" are designed to be an extension of the "like" button as opposed to a full-on replacement. Users will be notified when their posts receive "Reactions" in the same way they're notified about "likes." 2ff7e9595c


1 view0 comments

Recent Posts

See All

Comentarii


bottom of page