"Share on Facebook" - code

  • Started
  • Last post
  • 2 Responses
  • Sep

    I'm working on a "share this on Facebook" button for a wordpress website. Instead of using the standard script available on Facebook I tried this piece of code, which allows you to use a custom image:

    <script>function fbs_click() {u=<?php the_permalink() ?>;t=document.title;window.open('http://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>'+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script><a href="http://www.facebook.com/share.php?u=<?php the_permalink() ?>" onclick="return fbs_click()" target="_blank" title="Share This on Facebook"><img src="<?php bloginfo('template_url'); ?>/img/sharethis.gif" alt="Share on Facebook" /></a>

    Works great except the link doesn't open in a small window (626/436). I can't seem to find the problem...

    Someone care to take a look at this code and tell me what's wrong with it? Thanks.

  • ThePublics0

    check your mail

  • sureshot0

    what?