Archive for the Code Category

Boring Administrata….

Posted on Monday, January 31st, 2011 at 4:51 pm
Posted in Code, Site Notes | No Comments »

I’ve spent the last two days crawling through the inner workings of the site, trying to make it work better…. Half this post will read as “blah blah blah techno-blither blahdedattadee.” and I won’t be sad if you skip it. It’s mostly here to document some technical issues and how I resolved them, in case anyone is asking Google similar questions. ;) Read the rest of this entry »

WordPress: Category sensitive Digg links

Posted on Friday, August 28th, 2009 at 2:55 pm
Posted in Code | No Comments »

I wanted to add Digg links to all the pages in specific categories.  Smashing Magazine had a trick for adding Digg links based on custom fields, which is great if you are the person who can remember to add the custom fields.  I’m not.  Here’s a modified code snippet that you can add to your single.php file, to produce a Digg button on all pages in a list of categories:

<?php
   if (in_category( array('category1', 'category2', 'etc'))){
      echo '<script src="http://digg.com/tools/diggthis.js"
      type="text/javascript"></script>';
   }
?>