I’ve just implemented this trick on my personal blog for each category. In the left sidebar, I have a listing of my blog’s categories with the heading “let’s talk” (because I want to create and join conversations in these niches). Then, the heading of every category’s archive page has a Facebook Like button. When clicked, the reader is posting a link not to my site as a whole and not to a particular post, but to the category page itself.

Like Button for Category Archives

Why is this valuable?

  • It’s viral, offering one more thing people can share.
  • It gauges popularity of a given subject.
  • It allows me to market to a specific niche later via the Facebook page’s administrator controls (assuming you’re using your profile ID as the admin of all like buttons on your website via the Open Graph head tags).

The code below would need to be inserted in your category.php file just inside your content area and before you start your loop. Because themes are coded so differently, it’s impossible for me to show the specifics, but in my theme, it went just inside the “content” div.


 The first part is just my way of automatically echoing "Lets Talk About the Subject at Hand." −>
 class="category−heading"> printf( __( 'Lets Talk About %s' ), '' . single_cat_title( '', false ) . '' );?>

 I'm hard−coding part of the url parameter for Facebook based on my permalink structure for category archives, then adding the actual category slug with php. −>
 src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fbrandonacox.com%2Ftopic%2F if (is_category( )) {
  $cat = get_query_var('cat');
  $yourcat = get_category ($cat);
  echo $yourcat−>slug;
 } ?>&layout=standard&show_faces=true&width=450&action=like&colorscheme=light&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true">

That’s it. Quick and easy..