I just figured out how to add the Facebook “Like” button to every post in my blog. For those of you who use squarespace, this could be pretty useful for you. You must have jquery for this to run.
var url = $('.title a').get(index);
$(this).append('<iframe src="http://www.facebook.com/widgets/like.php?href='+url+'" scrolling="no" frameborder="0" style="border:none; width:450px; height:80px"></iframe>');
You only need to put this once, either in the header of your entire site or in the header of your blog that you want it to live on.
Please note from Rick (firstname.lastname@example.org):
I found you need to adjust the code to have the Like for each separate blog entry:
This section needs to look like this:
var url = $(‘.journal-entry .title a’).get(index);
it’s working on a website for a team I run: http://www.solobreakracing.com.
If you don’t, what happens is if you have other links on your website, you’re actually apply the Like to that website and not the actual blog summary.
So Squarespace has now integrated HTML Snippets into their system, thus making this hack unnecessary. You can still use this type of thing for other inserts but I would go ahead and use their system moving forward.