To be honest, this is something difficult you need to do, because there’s nothing more confusing than a list of links with no explanation. I’ve tried to add some basic conceptual basis to the With a linkness page, but I never could get it to the daily posts. Not that I cared, I tried to keep them buried, for the most part. The only reason I put them on this site was to make the links more accessible.
However, as much as I’ve worked to make it easy for people to figure out what they’re looking at, sometimes it’s just not fully apparent. So, using a couple of template tags and some PHP logic, I added some extra self-promotional MacStansbury magic to each of my del.icio.us blog postings. And you can too, if you’re not faint of heart, and don’t mind messing with the inner workings of your template tags.
A couple of caveats:
1. This is for WordPress, but it could easily be ported over to Movable Type or anything else with a template tag system that allows for if:else.
2. This is impossible to use in Blogger - there’s just no category support in this manner.
3. You’ll need a dedicated category strictly for del.icio.us daily blog posting.
I won’t lie to you, I came up with none of this myself. All I did was put some template tags together, and hoped it would work. It did, like this:
First, you get your category ID you’ve set up to publish the del.icio.us bookmarks. Trust me, if you don’t have a dedicated category set up, this won’t work, as you’ll get the extra stuff on every page. That ID (you can find out what it is on the Manage>Categories in your admin) is what you stick in this code I lifted borrowed from the WordPress Codex:
<?php if ( in_category('category_id') ): ?>
<p>Here's where all the magic happens</p>
<?php endif; ?>
Inside your template, you’ll have a page that calls the loop. Some templates actually call this file “theloop.php” for some odd reason. Wherever it is, say index.php or theloop.php or any other file name, somewhere you’ll find this:
<?php the_content(); ?>
That would be what you want directly underneath your code. Or, in my case, on either side of it. Here’s a sample of what it might look like:
<?php if ( in_category('6') ): ?>
<p><img id="image127" src="http://macstansbury.com/wp-content/uploads/2006/07/delicious-42px.gif" alt="del.icio.us" style="float:left"/>Powered by <a href="http://del.icio.us/MacStansbury">del.icio.us <a href=”http://del.icio.us/settings”>daily blog posting</a> I use for <a href=”http://macstansbury.com/linkness”>With a linkness.<br />Use the <a href=”http://del.icio.us/help/for”>for:macstansbury tag to send me links.<br />Here\’s the latest set of links.</p>
<?php endif; ?>
<?php the_content(); ?>
<?php if ( in_category('6') ): ?>
<p><script type="text/javascript" src="http://del.icio.us/feeds/js/networkbadge/macstansbury?nwcount;fancount"></script></p>
<?php endif; ?>
Don’t forget to add the paragraph tags, or you’ll get unpredictable results.
That will give you (roughly) what I’ve used on the posts in the del.icio.us backup category. Compare that to how the guy who showed me there was daily blog posting in the first place, Steve Rubel, with his daily links. Now you’ll have the option of either going with the extravagant MacStansbury lifestyle, with bells and whistles, or with the old-school, down-low style, sans all the jibber-jabber.