How to tart up a WordPress category page

holloway overhung with ancient trees n Cornwall

Since I’m running the new podcast from within a category here, I decided it was time to make some long-delayed tweaks to the category archive pages. Some of this information was surprisingly hard to come by, so I thought I’d share it here for fellow WordPress users (note that this only applies to independently hosted sites, not those on WordPress.com).

1. Displaying an RSS button next to the category title

All WordPress categories have their own feeds, but if you want to give your readers the ability to subscribe to them, you have to display them somewhere. I can easily envision someone being only interested in my Nature/Ecology or Photos categories, to the exclusion of everything else. But since I [used to] list my categories in a nifty slide-down menu (click the Browse link in the navigation bar), I couldn’t work the RSS links into a list, which is the usual approach. Why not display them at the head of each category archive page instead?

First I downloaded the standard orange RSS feed icons, uploaded the smaller one (14×14 pixels) to Via Negativa’s media library, and copied and pasted the URL into Notepad. Then after considerable searching, I found the requisite code, added the icon link in the appropriate spot, and placed it one space to the left of the bit that calls up the category title in category-archive.php. Here’s what I ended up with:

<?php
$this_category = get_category($cat);
print '<a href="'.get_category_feed_link($this_category->cat_ID, '').'"><img src="http://yoursite.com/wp-content/ ... /feed-icon-14x14.png"></a>'; ?> <?php single_cat_title() ?>

2. Adding the category description to the first page of the archive

You might’ve noticed that the categories section of the WordPress dashboard (left menu, Posts drop-down) allows you to edit each category to enter a description. These descriptions can even contain links — see for example my Photos category, where I’ve just added links to my photoblog and Flickr page. Most blog themes leave descriptions out, but they’re a great feature, I think. I don’t know why I didn’t do this a long time ago. Here’s the code:

<div class="category-description"><?php if ( $paged < 2 ) { ?>
<?php echo category_description( $category ); ?>
<?php } else { ?>
<?php } ?></div>

The conditional statement restricts it to the first page of the archive. The div definition of course can be anything you want, and one look at my current styling will tell you that I am not someone you want to consult on design.

I’ve barely begun adding descriptions to categories, and probably won’t add descriptions to all of them, but it’s looking like a good way to add additional information or important qualifications. And I just realized that the new descriptions appear as mouse-over text in this theme’s Browse menu, too. Far out.

3. Styling categories

The above tips barely scratch the surface of what’s possible. To create different styles for each different category archive, you have to create a new template file for each category and upload it to your theme. This involves copying and pasting the code from the main category.php into a text editor, then naming the file something like category-7.php, where 7 is the number id of that category. Finding that number is the only tricky part. In the categories section of the dashboard, move your cursor over the category link and look in the status bar at the bottom of your browser. At the end of the string, where it says cat_ID=x — that’s your number.

With new category template files in place, it’s just a matter of defining the CSS styles in the stylesheet and modifying the files accordingly. It’s not something I plan on doing, but I include it here for the sake of completeness. (Please note that if you want individual styles for posts on the index page according to category, that’s an entirely different procedure.)

4. Adding custom sidebar text to categories

This is another thing I’m unlikely to implement here, but it seems really useful for magazines and other not-so-bloggy websites. There are a growing number of plugins to apply this and other CMS functions, but not being a real geek I’m not really qualified to evaluate them, so you should really look elsewhere for authoritative assessments. (Not that you’ll find any: good information on WordPress is hard to find, lost in a sea of search-engine bait.) For what it’s worth, though, we’ve been using the new WP Custom Widget for qarrtsiluni’s first online chapbook (to add publication history notes in the sidebar of pages like this one), and it’s easy to use and still works fine, knock wood. So if I wanted to add custom text to category sidebars, I guess that’s where I’d start. The real way to do this is with conditional tags, but that requires some pretty gnarly coding — it’s not easy copy-and-paste stuff as in the examples above.

A social network for poetry

holloway overhung with ancient trees n Cornwall


Update: Read Write Poem ceased publication and dissolved its social network on May 1, 2010.

Back when I started this series, Dana Guthrie Martin volunteered to do a piece about sharing poetry on Facebook. Obviously she has yet to produce such an article. But instead, with the help of several friends, she’s done something far cooler: launch a Facebook alternative for poets and fans of poetry. I was one of about 15 testers for the site, which opened to the public at large yesterday: the new Read Write Poem. And based on what I’ve seen so far, I’d say there’s a good chance it will be a runaway success.

Up until Thursday, Read Write Poem had been a simple multi-author blog and weekly poetry prompt site, started by Dana in 2007 and managed for a year and a half by Deb Scott, who stays on as a member of the new managerial team. The prompts will continue, along with other great content and spin-offs, such as virtual book tours on members’ blogs and a podcast. (I’ve even volunteered to write a monthly column on topics similar to the ones I address in this series. We’re calling it “O Tech!”) But it’s the new back-end that really sets it apart.

Read Write Poem now runs on WordPress MU, the multi-user version of the blog platform, in order to take advantage of BuddyPress, “a suite of WordPress plugins and themes” designed “to let members socially interact.” BuddyPress is an official project of Automattic, the people behind WordPress.com who also comprise most of the lead developers for the open-source WordPress software, so it’s almost a sure bet that it will be around as long as WordPress itself. Dana and her technology guru Andre Tan looked at some other alternatives, such as Ning and Elgg, but ultimately decided that a BuddyPress set-up had the most flexibility for the kind of dual-purpose site they wanted. The website content is still at the front, as you’ll see, with the social network accessible via a new navigation bar at the top. The latest content from the network appears in the right-hand sidebar to help lure people in.

To me, this is a better approach than the usual social network style, which is to have one’s own activity stream take over for the index page as soon as one is logged in. I noticed that when I went to add a link to my browser bookmark bar yesterday, without really thinking about it I chose to bookmark the front page rather than my own profile page. I guess I like the tacit reminder that the site is about something bigger than just me and my network of friends and acquaintances. Facebook is still valuable because it lets me connect with virtually everyone and do some of the silly stuff I’ve never done much of at Via Negativa, such as pontificate about favorite music videos or participate in so-called memes. I can share links to poetry-related things (or whatever) with a much broader cross-section of people than just poets. But I’ve been using Facebook to connect with literary folks for close to two years now, and I can tell you that, for whatever reason, deep discussions rarely happen there. Almost all the groups I’ve joined are ghost towns — albeit ones that send out regular mailings to their members.

How does Read Write Poem compare with Facebook? The most glaring difference is the lack of a unified activity stream where I can follow all my friends’ posts to their profile pages — the equivalent of what Facebook calls status updates — in one place. Your only option for following friends at this time, short of visiting all their profiles, is to subscribe to their RSS feeds. And since most web users are unfortunately still in the dark about RSS, that’s not too good a solution. Though it’s somewhat hard to find at the moment, it turns out that there is a stream of one’s friends’ activity, similar to what’s in Facebook. Click on the “activity” link directly under the avatar on your personal page (I had thought that was merely an RSS feed link), and you can toggle between “just me” and “my friends” — and subscribe to either. [Thanks to Andre for the correction — see comments]

On the other hand Moreover, thanks to BuddyPress, Read Write Poem now has something that Facebook does not: forums. Some of these are free-standing and others are associated with groups. And if the last day and a half are any indication, the groups and forums are going to be the most active part of the site — which I feel is how it should be. Like a lot of writers and artists, I guess, I’m not a highly social person in real life because I’m not all that good at idle chit-chat, and because I’m rather zealously protective of my free time. Facebook, Twitter, etc. are fun, but what ultimately is the point? To me, the most interesting online social networks are those centered on specific hobbies or interests, such as Ravelry for knitters, Flickr for photographers, or Goodreads for book lovers. Long after Twitter and Facebook have lost their faddish appeal, people will still be trading knitting tips on Ravelry.

Then there’s the blogging connection. I’ve always been impressed by the way that the blogosphere can bring together like-minded people, and as a writing prompt site for bloggers, Read Write Poem has been helping to build such informal networks for a while now. I’ll be interested to see whether more people feel encouraged to start blogs as a result of membership in the new site. I saw one example of that yesterday, and another new member say that she had joined in part to try and work her way up to blogging. Since Read Write Poem retains a focus on weekly group writing exercises posted to members’ own blogs, there should be considerable peer pressure on non-blogging members to start blogs.

If so, it will be very positive outcome — and will further differentiate RWP from Facebook, where people are encouraged to upload photos and compose lengthy notes on-site. One result is that Facebook ends up with too much power over your content, and if your account gets suspended for some reason, you lose it. Dana and her co-conspirators have wisely decided not to try and turn Read Write Poem into a hosted blogging platform at this time, even though that is what WordPress-MU was designed for. It would mean a lot more time, money, hassle, and responsibility, and it’s not as if plenty of good blog hosting options don’t already exist. Still, it’s nice to have the freedom to spin off a few more blogs any time they feel the need without having to set up a new database with a fresh WordPress install, as would otherwise be the case. I gather they may do this down the road if the need arises for more narrowly targeted sub-sites.

So far BuddyPress has proved fairly intuitive to use — much more so than Facebook, for example. A few things still frustrate me, such as the lack of nesting throughout the network: whether in my personal news feed, a group “wire,” or a forum topic, I can’t reply to an earlier post in a thread and start a new branch, which seems to me a pretty basic need for a social network — even Identi.ca has that now (though Twitter and Facebook still don’t). I also don’t like the lack of RSS feeds or other opt-in subscription options for conversations. BuddyPress does offer group administrators the option to have members notified every time someone posts something, as happens on Facebook with every discussion in which one participates. But there’s no way for members to opt out, so none of the groups I’ve joined so far have enabled the feature. You can’t assume that everyone wants to get that much email.

Some people might be bothered by the lack of provision for private profiles, but for this kind of network I’m not sure there’d be any point in that. There are provisions for private, invitation-only groups, as well as for completely hidden groups, which should prove important for people who want to share poems and get critiques from just a few trusted friends.

Building a social network for poets is a risky business: we’re a notoriously fractious bunch. The managers have posted a code of conduct which contains a helpful list of “do’s,” such as:

  • Have fun (not “poke-the-skinny-kid-on-the-playground” fun, but “find-joy-in-expressing-yourself-and-reading-the-work-of-others” fun).
  • Make everyone feel safe and welcome.
  • Be generous with your enthusiasm and encouragement. And sincere. Always sincere.
  • Be respectful in comments sections on this site and on members’ sites. (In other words, our interactions are electronic dialogues; don’t spit on anyone or pull their hair.)

If most members follow these rules, and moderators and community managers are prompt in barring flagrant violators, it could turn into a really interesting place. In addition to Dana, Andre, and Deb, Nathan Moore and Dave Jarecki have also contributed considerable energy to building the site, and it appears to be a really active team overall. So far, the level of general excitement is high and discussions have taken off at many of the groups. The trouble is, I may have a hard time now going anywhere else! Though Dana & Co. may have thought they were creating a Facebook for poets, I fear that what they’ve actually created is flypaper for poets. You can hear the buzz from here.