As you may have noticed on this page or in your aggregator my normal entries are now interspersed with smaller link and commentary entries represented in an unordered list. These fall in chronological order with my other entries and are real posts with permalinks, comments, categories, trackbacks, and pingbacks. I have been wanting to do this for a long time and there was a flood of entries when I first got this working. I fully expect to post in this category with a much higher frequency than my normal posts. I come across things all the time that I want to link so badly but I just don’t have the time to write an entry about. Now every interesting tidbit I come across is just a click of a favelet away from my readers. It’s liberating.
The format of a weblog dictates its writing. There is no getting around this. Ever since my redesign I’ve had these big important titles that—as a writer—are intimidating. Everything I write has to be worthy of its 32-point Dante banner. This was a deliberate to force myself to put more thought and effort into my entries and it has worked; some of my best writing has been since the redesign. It has been stifling as well. To express what I want to express these days I need something more dynamic.
This type of linklog is nothing new. I first saw it at Kottke and since have enjoyed it at Charles Gagalac’s site. Charles was the first person I know of to do it in WordPress. This inline style fits my requirements very well, the biggest being that I wanted to use my existing post taxonomy so a second weblog would have been inconvienent. I also get the benefit of a combined RSS feed and combined update pinging. More than all of that though, I don’t want to limit myself to one type of post in a new weblog, or in this one. I already have plans to use this feature to not only highlight interesting links, but comments I make on other sites, upcoming gigs I have, photolog updates, and various activities and writing I now have spread out over a half-dozen blogs. It’s a perfect application for WordPress‘ multiple sub-categories feature. Technically, the whole thing was very easy to implement.
First I made a new category all of these posts would be a part of, it was late and I couldn’t think of anything too clever, so I went with “Asides.” This may have been subconciously inspired by Movable Blog. So I created the category in WordPress, and it had an ID of 33. Next it was simply a matter of telling my template that if a post was in the Asides category to lay it out a little differently. I wrote a quick function, in_category() that does this with no additional DB queries that is now in the WordPress CVS and will be in the 1.2 release. The function takes a single argument, a category ID, and it returns true if the current post is in that category. Here’s what I have in my post loop:
<?php if (in_category(33) && !$single) { ?>
<ul class="asides">
<li id="p<?php the_ID(); ?>"><?php echo wptexturize($post->post_content); echo ' '; comments_popup_link('(0)', '(1)', '(%)')?> <?php edit_post_link('(e)'); ?></li>
</ul>
<?php } else { ?>
So basically what this is saying is that if the post is in category #33 and we’re not on a permalink page to format it using that code, otherwise do our normal thing. We have a simple unordered list with a uniquely ID’d list item. (The ID is a throwback to about two years ago when I had a heavily hacked version of b2 with monthly archives. Can’t let those permalinks break.) I get the post content directly because I didn’t want to mess with the normal filters (like autop) applied to the_content(). I run it through texturize to keep everything pretty. Then I have a simple comment link, and finally a link that only I see that allows me to easily edit any entry. This worked great, but you can see that I have a separate unordered list for each entry, which isn’t what I want; I want all consectutive aside entries to be part of a single list. This gets tricky because you have to start the list when the current entry is an aside but the newer entry and stop it when the next entry is not an aside. Tricky tricky, and I don’t want to think what would happen if someone decided to reorder my content. I had only allocated myself ten minutes for this entire project and I was at minute number eight, so it came time for ugly code:
function stupid_hack($str) {
return preg_replace('|</ul>\s*<ul class="asides">|', '', $str);
}
ob_start('stupid_hack');
I swear that’s the actual code in my template. Put it somewhere around the top of the template, it really doesn’t matter where. It’s a hack, but it’s been working great. Simon says it is “ugly as sin,” and that’s what I thought when I wrote it. Since then, however, it has grown on me a bit. It’s like the supermodel who goes out every day dressed to the nines relaxing at home in a bathrobe, slippers, and no makeup. I keep the pretty code elsewhere, here at home I’m a little more casual. Perhaps when I have a little free time I’ll put in the more complicated logic I described above but if it ain’t broke…
Possibly related posts:
- Art Direction Plugin WordPress “Art Direction” Plugin, from Automattician Noel Jackson. Basically allows...
- Tune in to WordPress.tv Today we’ve switched on WordPress.tv, a new space to geek...
- Ask Matt! Ask me a question here and I’ll pick the best...
- Top Emailers 2008, etc As an update to last year’s post: Toni Schneider —...
- Berlin WordPress / Web 2.0 Expo Drinkup I’m in Germany for the first time and I’d love...

Pingback: Blogging Pro - Blog News, Tools and Hacks » Quick Links
without loss of generality » Asides Implemented | July 21st, 2004 @ 5:51 am |
[...] [...]
Pingback: Peiratikos » Linkblogging and site updates
Pingback: rebelpixel productions » Blo.gs Blogroll for WP-1.2
Pingback: rebelpixel productions » Blo.gs Blogroll for WP-1.2
Pingback: synapse » Asides: yum. - Friday 11th June, 2004
Retrospecticus :: On the Web | June 20th, 2004 @ 8:00 pm |
[...] [...]
Pingback: 14LB » On Writing (for this weblog)
Pingback: wujibee » Functional Asides!
Pingback: somefoolwitha.com » Photo Matt » On Asides
Pingback: Weblog Tools Collection » “Asides” for WordPress from Mullenweg
Pingback: Om Malik on Broadband » Open Casting Call…
Pingback: Brilliant Corners » Handy link log solution for WordPress
:: mathibus.com » archives » wordpress: redesigning the comment form | June 21st, 2004 @ 9:20 pm |
[...] [...]
Pingback: Beta Thoughts » Beta Thoughts - Slightly loaded
Some Content » Design notes | July 15th, 2004 @ 2:48 pm |
[...] [...]
reizbombardement.de » Quicklinks [05/07/04] | July 5th, 2004 @ 8:55 am |
[...] [...]
Schmierzettel.NET » Bloggroll und Recent Links von rebelpixel.com | June 14th, 2004 @ 6:47 pm |
[...] [...]
Pingback: Uberwald
joshuatompkins.us - version 7.0 | June 14th, 2004 @ 7:52 pm |
[...] [...]
Pingback: twenty4.org » Recent Links
emmott.net » Photo Matt - On Asides | July 7th, 2004 @ 8:39 pm |
[...] [...]
Pingback: wujibee » wujipress
techfreak.net » Asides | June 27th, 2004 @ 7:31 pm |
[...] [...]
Pingback: Brad Froehle » Switch to WordPress
Pingback: Brad Froehle » On Asides
Nate Ritter: Web Chef » LinkLog a.k.a. Matt’s Asides | July 28th, 2004 @ 9:27 pm |
[...] [...]
Le Blaugue à Beleg | | July 19th, 2004 @ 1:01 am |
[...] [...]
not sweet words » On Asides | July 9th, 2004 @ 4:31 am |
[...] [...]
Pingback: atog » Asides
Pingback: manalang.com » Movable Type to WordPress Switch
Pingback: chrispederick.com - Moving
Alex | May 19th, 2004 @ 4:07 am |
Thank you for sharing the information, I had “asides” running on my site for some time now using this tip. I tried to impliment your method (because I does not mess with autop), but it creates a weird problem with links. s are added where they don’t belong in links and abbreviations i.e.
<a href="http://secure.sixapart.com/">?nikkiana | May 19th, 2004 @ 4:48 am |
/me decides she needs to do this with the next generation of everytomorrow.org.
Alex | May 19th, 2004 @ 5:32 am |
Argg, my comment got all messed up.
Michael Heilemann | May 19th, 2004 @ 6:27 am |
I’ve been using Charles’s variant for a few weeks now, and it’s working great. Except of course for the fact that entries are being sorted chronologically and not categorically and then chronologically. I swear, I need to teach myself PHP so I can do these kinds of things myself and not continually apply pressure to you WP guys
Geof | May 19th, 2004 @ 8:55 am |
An interesting approach.
Beth | May 19th, 2004 @ 9:34 am |
I’d really like to get this code up and running on my blog but I’m having trouble. I’m struggling to know where in the loop to place the code and how to terminate it so that I don’t get a parse error at this line
<?php endforeach; else: ?>Have you any advice? Thanks
Trent | May 19th, 2004 @ 1:53 pm |
Ever since my redesign I’ve had these big important titles that—as a writer—are intimidating.
Oh my god, I wrote almost the same exact sentence yesterday in my post announcing my redesign. The problem with the way my old site used to look was each post felt so BIG. Hopefully, my new design will make it easier on the eyes when I post a bunch of one or two liners.
Pingback: Warnadunia.NET, MISC, Links
John | May 19th, 2004 @ 3:23 pm |
Matt, can you provide where you added the < ?php if (in_category(33) && !$single) { ?>… code?
Pingback: Virulent Memes
David Collantes | May 20th, 2004 @ 6:55 am |
Matt, you are mssing a on the stupid_hack, it is:
return preg_replace('|s*|', '', $str);
And it should be:
return preg_replace('|s*|', '', $str);
David Collantes | May 20th, 2004 @ 6:56 am |
Darn, comments destroyed. It should be s* instead is just *s.
Matt | May 20th, 2004 @ 7:06 am |
ENCODE YOUR HTML! Or don’t post code.
Pingback: engadgeted.net
Chris Owens | May 22nd, 2004 @ 2:06 pm |
RE: Comment 6
I have the same problem, where exactly are we supposed to put the code if we were using the default unmodified template?
Mark | May 22nd, 2004 @ 11:41 pm |
You preg_replace is a little borked
`return preg_replace(’|s*
|’, ”, $str);`
flump | May 24th, 2004 @ 9:20 am |
it seems i have to scroll down a page before i can get to your content. i don’t really know what all those links are, and wether or not i should be reading them.
*shrugs*
Pingback: Blogging Pro - Blog News, Tools and Hacks
Chris L | May 25th, 2004 @ 12:42 am |
I’ve been thinking about how to integrate the “link and run” part of my weblog for a while. Nothing has worked as well as I would like.
But I have to say that the way you are doing it has taught me a clear lesson in how not to do it. It’s very annoying to have to sift through such a length of links to see the real content. I much prefer either a separate log (for frequent posting) or these links consolidated into a daily/weekly/irregular posting (for less frequent posting).
I hope I can find some way to subscribe to the two separately still!
Matt Brubeck | May 25th, 2004 @ 2:17 pm |
Could I request a separate RSS or Atom feed that includes only the long posts (not the asides)?
Matt | May 26th, 2004 @ 2:40 am |
Yeah I’m going to do a seperate feed.
Brad Froehle | May 27th, 2004 @ 6:53 pm |
We know that Matt really meant to write: (note the additional \)
function stupid_hack($str) {return preg_replace('|</ul>\s*<ul class="asides">|', '', $str);
}
uberwald | June 4th, 2004 @ 12:00 pm |
Can you give me any kind of guidance about where to place the stupid_hack code?
Matt | June 4th, 2004 @ 12:05 pm |
For those having trouble I posted my entire index template to the wiki:
http://wiki.wordpress.org/PhotoMatt/index.php
Rayne | June 10th, 2004 @ 10:48 am |
Does that function in_category also scan the children categories? I need to exclude posts from a certain category and all it’s children, because those posts are being used for something other than my “blog”.
Pingback: Jeremy's Little Corner Of The Web...
mark | July 8th, 2004 @ 1:30 pm |
Here is my situation. I have a site where there are 5 bloggers, each with their own category. I have them all as the same level, but don’t want them to be able to edit each others posts. Is there a quick index.php hack to make this happen? I’ve posted in the wp support forum, but havent gotten an answer. Thanks.
bruce | July 11th, 2004 @ 12:49 am |
Great tip.
It wouldn’t seem like such a silly hack if you called it combineAdjacentAsideLists() or something sensible like that!
Pingback: Memoirs of a Geek
Liam Page | July 17th, 2004 @ 6:39 am |
Very nifty. Can’t get that stupid_hack to work for the life of me, though (PHP and WP are both still a little new to me).
Pingback: without loss of generality
dr Dave | August 13th, 2004 @ 12:01 pm |
Is there any reason why you would not want to use a simple flag to signal the opening and closing of a group of asides?
Granted this isn’t the prettiest code either, but it definitely beats having to parse all outputs searching for regex matches.
Something along the line of:
if (! $opened_list)
{
    $opened_list = true;
    echo "
";
}
and
    if ($opened_list)    {
        echo "";
        $opened_list = false;
    }
both judiciously placed within the template (there’s more to it, but it’s fairly trivial, I think), ought to do the trick…
dr Dave | August 13th, 2004 @ 12:03 pm |
arg. damn formatting function ate my <ul> and </ul> in the previous comment…
Pingback: nico :: pinjons >>
Matthias Heil | August 21st, 2004 @ 9:32 am |
I’m having problems with this lovely hack. I get all sorts of parse errors (”unexpected $ in /…/wordpress/index.php on line 184 – that’s towards the end of my index.php (for a readable version: http://www.matthiasheil.de/wordpress/index.phps – Could it be I’m missing out on sth important here?
Thanks for your help!
Matthias Heil | August 21st, 2004 @ 4:27 pm |
I’ve got it sorted – thanks to Beel@Wordpress! – I love this mod, especially when combined with the FeedDemon2WP-Hack!-)
Pingback: Binary Thoughts
Pingback: 2200N-DK » Blog Archive » Asides
Pingback: Devsyn Development Studio » Blog Archive » Recommended Reading
Gianko | October 17th, 2004 @ 2:23 pm |
I’m looking for something jut like this…
but what if I don’t want the post to appear at all!!!??…
like, I don’t want the post on the category 33 to show in my index.. never… (not even in the montly archives)
who do I do that???
can you help me???
Steven | October 25th, 2004 @ 4:25 pm |
Anyone implement this with Kubrick 1.2.6?
Pingback: The Wyvern's Lair
Pingback: ... do not use lifts » this could get messy: sending lemmings to their doom for as long as they can remember...
Pingback: my playground » Photo Matt » On Asides
Pingback: Jeremy's Little Corner Of The Web... (Test Blog) » Blog Archive » Plugins
Pingback: the life of justin moore » Blog Archive » baby steps
Pingback: Somewhere out there! » Photo Matt » On Asides
Pingback: Notizen fuer Geniesser
Pingback: skebrown » The RustAsides WP 1.5 Plugin & Photo Matt’s Asides
Pingback: Note to self… » Blog Archive » Finally I got a linkblog!
Pingback: superporcel » The RustAsides WP 1.5 Plugin
Pingback: serialdeviant.org(y) » Matt’s Asides
Pingback: The Cat’s Whiskers » Tidying up
Pingback: Prospectus Y » Blog Archive » Implementing Asides…
Pingback: hemma.pihl.org » Blog Archive » Photomatt
Pingback: digital.goth.geek » Asides
Pingback: Phon[j]e » Blog Archive » New Shit
Pingback: No Idea » New Single Column Design
Pingback: askewed » Asides
Pingback: SteelPixel » Blog Archive » Yet Another Wordpress Asides Solution
Pingback: Linkstew » Blog Archive » Links To is dead.
Pingback: Firman Pribadi
Pingback: the eXternal mind » Blog Archive » Simple Asides Wordpress Plugin
Pingback: dot-totally.co.uk - Blog Archive » Indy and the Ball of Doom
Pingback: 15june.com
Nat | July 15th, 2005 @ 2:10 pm |
very cool. ive found it easier to use the miniblog plugin though
Pingback: El blog del Señor Bohnke » Asides o miniblog
Pingback: PostSecret at Tankespredt
Pingback: More experiments, a welcome assignment and NerdTV at Leon Kilat ::: The Cybercafe Experiments
Pingback: Could you give me a wordpress[dot]com? at Simply Lotus
Pingback: at brokenchords|dot|org
Pingback: Asides effect at ericsetiawan.com
Seth | September 14th, 2005 @ 7:46 am |
Matt, I’m using Asides as implemented in K2 in WordPress.
I’d like to know if it’s possible to control how many posts appear in a list of asides and how long it takes for them to fall off the list. Where can I control these variables?
Pingback: 새로운 ì›Œë“œí”„ë ˆìŠ¤ 테마 “K2″ Beta1 at . 0 8 2 N e T .
Pingback: cHello! at loudestnoise
Pingback: Carpe Diem » On Asides
Pingback: Massive Reorganization at the pygmalion effect
Pingback: Leon Kilat ::: The Cybercafe Experiments » Testing asides
Pingback: La mate por un yogur » Asides o miniblog en WordPress
Pingback: N. Godbout » Blog Archive » Asides
Pingback: This is an Aside at David W. Boles’ Urban Semiotic
Pingback: Candy, by AkaXakA » Journal Archive » First Asides..
Pingback: deuceweb.net » Mini-Posts!
Pingback: nybble’s blog » Well I Sort Of Did It…
Pingback: Tidying up at Thought Pixels
Pingback: xhBLOG » Estrenando MiniBlog
Pingback: phil ringnalda » Blog Archive » Linkstipation
Pingback: uruloki’s lair » Here we go again…
Pingback: 天佑的自由天地 » Blog Archive » Extended Live Archive 0.10 版本教å¸
Pingback: [LINICKX].com/blog » Implementing Adsides in wordpress
Pingback: sebastian - a singapore rat » Blog Archive » Asides - Working Well!
Pingback: BUZZURRO » Asides
Pingback: Redesigns and experimentations - If..Else Log
Pingback: untitledlife » Blog Archive » 2006, 1.5, and a 12-pack.
Pingback: renet@web » Blog Archive » Site enhancements
ThePete | January 4th, 2006 @ 6:13 am |
Hi Matt, not sure if you’re still checking your comments for this post but I was wondering if there was a way to adapt this code to handle more than one category. I’d like to have a number of different layouts for a number of different categories (about five or so). I’ve tried monkeying around with the code a bit but I can’t work it out. It seems like a relatively simple prospect to me, but I could be wrong since I’m a PHP n00b. Thanks for this great tutorial regardless. I do have asides working just fine on my site.
Pingback: Asides at Just Dreams
Pingback: chuck reynolds
Pingback: groogsblog » Blog Archive » Testing asides
sebastian | January 7th, 2006 @ 3:18 am |
thepete, are you thinking something that is more complicated than just:
i was thinking of using this blank quote to block out all photoblog entries, with access to photoblog entries only by clicking on the photoblog category link. think i’ll work? =)
Pingback: Scott McDaniel » Blog Archive » WordPress Asides through my diggs and my del.icio.us
Pingback: Dressing up at # blog.apushoehle.de
Pingback: immakiku.net » Blog Archive » aside
Pingback: Wordpress Sticky Links Mod - Notablog
Pingback: immakiku.net » Blog Archive » Published, Phase III
Pingback: Asides - Linjakohinaa
Pingback: Xjanker BLOG » Blog Archive » Extended Live Archive 0.10 版本教å¸
Pingback: Snippets Back In Action @ SasEz! Scattered Thoughts
Pingback: Do not consume this! » K2 Beta
Pingback: vanus 01 » Blog Archive » Asides o Miniposts en WordPress
Pingback: Test Aside at AxBlog
Pingback: New theme at Talking Out Of Turn
Pingback: जोकà¥à¤¸ असाईड at नà¥à¤•à¥à¤¤à¤¾à¤šà¥€à¤¨à¥€
Pingback: browserd.com » Blog Archive » Não há maneira de atinar com isto.
Pingback: figby.com » Moving to WordPress
Pingback: I officially support “Asides” at indiekidonline
Pingback: Reborn … like a Phoenix! at Deranged Hermit
Pingback: linklog | fjurl
Pingback: Writer’s Blog » Blog Archive » Asides
Pingback: Writer’s Blog » Blog Archive » Asides
Pingback: Tarski · 1.1 Release
Pingback: at Hangover Sunday
Pingback: oscarbarber.com » Blog Archive » Asides, Links rà pids pel teu Wordpress
Pingback: Creating my own WordPress theme, but not from scratch at Leon Kilat ::: The Cybercafe Experiments
Pingback: New Format! at Blog to Eleven
Pingback: Blokura » Cómo crear asides o miniposts o mini artÃculos en Wordpress 2
Pingback: New Theme and Features at Kyle Schneider
Pingback: A Typical Grad Procrastinator » Blog Archive » New Section “Asides Besides”
Pingback: Hi K2 at mr lim
Pingback: John’s the man at connecting*the*dots
Pingback: The Swamp » The Great Divorce
Pingback: digital.goth.geek » Blog Archive » Asides
Pingback: Alan’s Kiloblog » Blog Archive » Asides in WordPress
Pingback: Alan’s Blogometer » Blog Archive » Aside
Pingback: Ensellitis.com » Ensellitis v12 theme
Pingback: Moiblog por Moises Kirsch » Archivo » Reboot
Pingback: incoherently surreal » Who will think of the children?!
Pingback: Buhkan Mountain Breakdown · An aside about the asides . . .
Pingback: Yuekai.NET » Asides
Pingback: Hyvä yritys at Valontuoja
Pingback: Memetic Selection » Blog Archive » Another new toy
Pingback: » Asides for Dummies
Pingback: ][ mkhDev ][ مازن بن عبد الله مليباري ]
Pingback: Asides at No Grasp of Your Reality
Simran | July 3rd, 2006 @ 10:58 am |
Amazing hack! I’m using it on my blog. It’s built into the great K2 theme. Thanks again man!
Pingback: Ryan Irelan » Prelude to a Redesign
Pingback: Agendacide: Minutes from Somewhere Else » Asides vs. Acides, Har!
Pingback: Mengaktifkan Asides at iqbalir
Pingback: Mark is on the move at light in the shadows
Pingback: twochains.com · The Podcast, delayed
Pingback: New theme - bannedwidth.org
Pingback: Frozen Flame Studios
Pingback: Matt Thomas » iamv3
Pingback: Open Study » Blog Archive » What are Sidenotes
Pingback: A drafted blog entry gone meta at DLTQ.org
Pingback: WP Theme Review: Redoable 1.1 » JaypeeOnline
Pingback: Nearthwort Obtain » Asides
Pingback: Stilgherrian · Weekend website tweaks
Pingback: openswitch » WordPress Tumblog How-to
Pingback: Transformatum | Blog Archive | More Tumbling on WordPress
Pingback: Blogico.net » Blog Archive
Lawson Digest | March 23rd, 2008 @ 7:46 am |
I couldn’t agree with you more. I did the same thing on my website.
Pingback: Encephalosponge » Soaking Up Life
Pingback: Asides | George Pearce's Blog
Pingback: Upgraded to WP 2.5 and Changed Theme | Raam Dev’s Weblog
Pingback: Subbu’s Weblog » Oh Boy.. Yet another design change!
Neil | August 25th, 2008 @ 5:21 am |
http://blog.photoneil.net/2008/08/24/really-easy-asides-for-wordpress/
I used your code a little and code for elsewhere to pull the asides posts off.
Stephen M. James | January 7th, 2009 @ 8:54 am |
I took your idea for Asides and pull in my Twitter RSS (@smjdesign) via Alex King’s TwitterTools. Twitter makes a very good way to add asides to your blog. You might consider it. Semantically–for my use, they are the same.
I have it working on a personal website. I doubt that I will be adding it to my professional websites anytime soon due to the “off-topic-ness.” Make sure though if you bring them into your blog and subsequent RSS feed that your entire homepage isn’t full of tweets/asides!