Archive for the 'word press' Category

WordPress 2.7 Beta

I’m all beta’d up, and I have to say… wow. There are just some really great layout and organizational enhancements in here. I’m excited to start playing with this in depth, but so far I’m really digging it.

Posting from my iPhone

I’ve just been accepted into the iPhone developer program (as part of Clockwork), and I’m pretty stoked. So far I haven’t donemore than read a bunch of docs & tutorials and compile my co-worker’s demo app, but I’m looking forward to diving in headfirst.

Anyway, to celebrate, I found the wordpress app and installed it. First time using it, but it’s not bad!

no k2 in the WP theme directory…

I went to the theme directory tonight with the sole purpose and intention of voting on the one theme I’ve been more than happy installing (K2, duh) and it wasn’t there! I assume this is because they’re working hard on 1.0, trying to get that out before they add K2 to the throng of themes already up for grabs. (They’re on RC7 now, I think.) Anway, I hope it’s that, and not that there’s some feuding or some other BS reason K2 isn’t listed.

Anyway, then I ended up following some links, and poking around in the K2 google code pages, and remembered that I’d started a thread asking for a particular feature for K2 back in February. I hadn’t visited the issue page in all that time, but there had been some responses, including a developer who said if I made a patch for the feature I was requesting, he’d see that it went in.

So tonight I made a patch. This officially marks the first time I’ve actually contributed (code) to an open source project. I suppose I’ve helped plenty of people on support forums and things before, but if this code makes it in, I’ll be… a geek hero or something.

how to show an excerpt from the first post in a category in wordpress

For ReadComics.org I wanted to show the latest Book Club entry in the sidebar. For those of you who are not familiar with the way WordPress does its posts, it uses some funky wrapper functions to access (and sometimes print) the entries in your blog. The main wrapper function, and the one that controls most of the stuff on the page is called the_loop().

This might be getting too detailed… You probably just want to know how to do what I did. There’s a lot more details on wordpress.org about using multiple loops on one page, but basically, the technique I used was to specify a new loop by using one of its internal functions called WP_Query directly.

WP_Query() takes an argument that tells it to just get the latest post from the book-club category. That looked like this: <?php $bc_query = new WP_Query('category_name=book-club&showposts=1'); ?> This uses category slug (“book-club” in my case), which you can find by editing your category.

So then you can use the standard functions like the_title() and the_excerpt() in a while loop. So the whole thing looks like this:


<li><h2>Next Comic Book Book Club</h2>
<!-- Get the last post in the book-club category. -->
<?php $bc_query = new WP_Query('category_name=book-club&showposts=1'); ?>
<?php while ($bc_query->have_posts()) : $bc_query->the_post(); ?>
<a href="<?php the_permalink(); ?>" alt="Read more about the next book club meeting." title="Read more about the next book club meeting."><?php the_excerpt(); ?></a>
<?php endwhile;?>
</li>

…and yes, I know the_excerpt() creates paragraph tags, and anchor tags around paragraph tags probably doesn’t validate. Oh well.

Today is…

…the 2 year anniversary of the day that florence and I met.
…the first day of national poetry month.
…April Fools day.
…the day I upgraded to livingtech.net to WordPress 2.5.
…the first day… of the rest of my life.
…nothing special.
…the most special day EVER.
…getting old already.
…more than half over.
…a clusterfuck of ellipses.
…just another word that means time has passed and our lives are ceaselessly marching into the future regardless of hesitation or observation or introspection.
…beautiful.

back to readable…

OK, I think I’ve got the layout here more or less back to readable. I’ll probably be making tweaks to the stylesheet indefinitely, but for now at least I’m happy enough with the colors to not feel totally disgusted. Astute WP geeks will notice that I installed K2, and also Twitter-tools, which doesn’t play terribly well with WP 2.3, but it’s good enough for now. I didn’t expect it to create entries for all my old tweets, but I guess I can live with that… (I may delete a bunch of them when I get around to it.)

Mike and Jason and Florence and I all went to The Source this afternoon. Florence and I picked up the first two issues of Cory Doctorow’s Futuristic Stories, which I think is a comic re-telling of his “When Sysadmins Ruled the Earth“. (I haven’t read them yet.) We also picked up the new Buffy (Florence is a huge fan), and a new Luna Brothers comic called “Sword”, (issue 1), and the new Groo comic. Of these, I’ve only read the Groo so far. (One of my guilty pleasures.)

We’re planning on seeing the 4:45 showing of Wristcutters: A Love Story at the lagoon.

who loves upgrades?

I have been too lazy to change this default theme. Soon. maybe. someday. possibly.

In the mean time, enjoy this braindump I haven’t actually typed up yet.