How to Add Facebook Send Button in WordPress

Now that you know that this is useful, lets add it in your WordPress posts. First open your single.php file in your theme’s folder, then paste the following code inside your loop (In some themes, you will need to locate loop.php file to do this):

1
2
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:send href="<?php echo get_permalink(); ?>" font=""></fb:send>

But the problem with above code is that it is not the best method. Facebook Send Button can only work well when it is in combination with the like button because without it, it has no social effect. So let us show you how to combine the like button and Send button in one like we have it in this post above.

1
2
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="<?php echo get_permalink(); ?>" show_faces="true" width="450" send="true"></fb:like>

As of now, the send button does not work with the iFrame version of the Like Button, so you would have to use it this way.

Once you paste the code, you are done. You should see something like what we have at the top of our post. (Click on the button to see its functionality )

There are other parameters and options for this plugin.

If you want to show the friend icons under the button, then you should use the parameter:

show_face=true

If you want to display the simple button with only the count and nothing else, then you want to use the parameter:

layout=box_count

If you want a darker color scheme for your button, then you need to use the parameter:

colorscheme=dark

If you want to change the text from Like to Recommend, then use the parameter:

action=recommend

We think that this send button will be very helpful. Because it is very new

1
2
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="<?php echo get_permalink(); ?>" show_faces="true" width="450" send="true"></fb:like>

As of now, the send button does not work with the iFrame version of the Like Button, so you would have to use it this way.

Once you paste the code, you are done. You should see something like what we have at the top of our post. (Click on the button to see its functionality )

There are other parameters and options for this plugin.

If you want to show the friend icons under the button, then you should use the parameter:

show_face=true

If you want to display the simple button with only the count and nothing else, then you want to use the parameter:

layout=box_count

If you want a darker color scheme for your button, then you need to use the parameter:

colorscheme=dark

If you want to change the text from Like to Recommend, then use the parameter:

action=recommend

We think that this send button will be very helpful. Because it is very new

Be the first to comment

Leave a Reply