---
title: How to Use Manual Social Button Placement with the New Facebook Plugin for WordPress
date: 2012-06-13T08:46:53+00:00
modified: 2013-08-28T11:28:53+00:00
permalink: https://kaspars.net/blog/facebook-for-wordpress-manual-social-button-placement
post_type: post
author:
  name: Kaspars
  avatar: https://reverse.kaspars.net/gravatar/avatar/92bfcd3a8c3a21a033a6484d32c25a40b113ec6891f674336081513d5c98ef76?s=96&d=mm&r=g
post_tag:
  - How to
  - Snippet
category:
  - WordPress
---

# How to Use Manual Social Button Placement with the New Facebook Plugin for WordPress

The [new Facebook plugin for WordPress](http://techcrunch.com/2012/06/12/facebook-wordpress/) is really nice — well written and uses only the best practices in WordPress plugin development. Here a few tips to help you customize the functionality of the plugin.

### Customizing the Social Sharing Button Location

All of the sharing buttons are added automatically to your post content (both before and after it), which is a kind of behavior that you might want to overwrite from within the theme. The four filters it uses are the following (in `<a href="http://plugins.trac.wordpress.org/browser/facebook/trunk/social-plugins/fb-social-plugins.php">social-plugins/fb-social-plugins.php</a>`):

```
add_filter( 'the_content', 'fb_recommendations_bar_automatic', 30 );
add_filter( 'the_content', 'fb_like_button_automatic', 30 );
add_filter( 'the_content', 'fb_send_button_automatic', 30 );
add_filter( 'the_content', 'fb_subscribe_button_automatic', 30 );
```

In order to remove the automatic placement of those buttons, simply remove the filters by running `remove_filter` (in `functions.php`, for example):

```
remove_filter( 'the_content', 'fb_recommendations_bar_automatic' );
remove_filter( 'the_content', 'fb_like_button_automatic' );
remove_filter( 'the_content', 'fb_send_button_automatic' );
remove_filter( 'the_content', 'fb_subscribe_button_automatic' );
```

and then define a set of custom actions that you’ll call in the exact places where you want the buttons to appear in your theme files. For example, here is an example of a custom action for the Like button that you’ll define in the `functions.php` and then use the `do_action` call in the places you want to echo the button:

```
add_action( 'my_fb_like_button', 'get_my_fb_like_button', 10 );

function get_my_fb_like_button() {
	$options = get_option( 'fb_options' );

	echo fb_get_send_button( $options['send'] );
}
```

And then in `index.php`, `single.php` and `page.php`, you call:

```
<div class="social-buttons">
	<?php do_action( 'my_fb_like_button' ); ?>
	Your other social buttons...
</div>
```

This way it will not brake your site if you deactivate or remove the plugin.

### No Syncing of Facebook Comments with WordPress

This is my bigest gripe with the plugin — you still don’t get a complete and proper integration of Facebook comments with WordPress built-in comment system. What they call “Comments with SEO support” is actually retrieving comments from Facebook and caching them in the transients table, and displaying them on posts inside `<noscript>` with follow links to the Facebook profiles of the comment authors. I really wish they either improve this or somebody creates a plugin that adds this feature.