Timestamp Plugin for WordPress

WordPress has a nice ability to set the post date on a blog entry to whatever the hell you want it to be. The only problem is, the default is that the timestamp field is hidden and the user has to click on a link to expand it. Which is a real pain in the ass if you use that feature a lot to schedule posts.

Mark Jaquith solves that problem with a one-line plugin that keeps the timestamp field open automatically.

Customizing WordPress Tag Pages with Conditionals and AnyVar

WordPressI’ve been looking for a way to customize the text shown on Tag pages. For some Tag pages, I’d like to include additional information related to the topic. For example, on the World of Warcraft tag page I might want to include information about my toons and links to the WoW Armory.

The official WordPress documentation, which is in general subpar, suggests creating a tag-[tag].php template for each tag you want to customize. So for my WoW example, I’d create a tag-world-of-warcraft.php template and include the custom changes there. And then do that for potentially hundreds of tags. And then edit each of those templates anytime something changes. No thanks.

A better solution is to use conditionals in the tag template in conjunction with a text substitution plugin such as AnyVar.

AnyVar lets you create text substitutions that can be placed anywhere within a site. For example, for my World of Warcraft example, I can compose a couple paragraphs about WoW and assign in to world-of-warcraft-var. Then, in the template, I just surround it in brackets like this: [world-of-warcraft-var], and AnyVar will handle inserting my text there. Anytime I want to update that text, I simply go in to AnyVar, change the text there, and it gets updated instantly.

Then it’s just a matter of inserting something like this into the tag.php template:

<?php /* If this is the World of Warcraft tag archive */ if( is_tag(world-of-warcraft)) { ?>
[world-of-warcraft-var]
<?php /* If this is a tag archive */ } elseif (is_tag()) { ?>
<h1><?php single_tag_title(); ?></h1>

Obviously you’ll need a separate if(is_tag(tag-name)) conditional for each tag that is going to have any customized content.

It’d be nice if there was a plugin that would do this automatically, but this is fairly straightforward and a lot easier than littering a site with dozens of different tag templates.

Keeping a WordPress Site Private

WordPressBoth of my children known my wife and I have blogs, and they’ve wanted their own sites to post their artwork and pictures and write about the things that are important to them. So I went ahead and created a couple subdomains and installed WordPress. But since they’re still young, I wanted to password protect the entire site so only logged in users can view their blogs — that way I can give a guest username/password to family members who might be interested, while locking everyone else out.

The bizarre thing is that WordPress does not support this out of the box. If you want to do this with WordPress, you’re going to have to install a plugin. And — lucky me — all of the plugins that do this are broken because WordPress changed how it handles authentication cookies in 2.5. I ended up downloading Angusman’s Authenticated WordPress Plugin, then modified the code to take into account WP’s new preferred authenticaton method, but it was a pain.

What makes this particular feature a bit odd by its absence is that Automattic does offer folks who sign up for a blog at WordPress.Com the option to hide their blog, so its not like this is a feature (like caching) where the devs are just idiots and think nobody wants that.

Given how simple the code to make a site private is, it is silly that this capability isn’t already integrated into WordPress.

WordPress Problem In Search of a Solution

WordPressSo awhile ago, I converted all of my WordPress Categories into Tags, and overall I’m much happier managing 1,000+ tags than 1,000+ categories (which is really because WordPress’ category implementation sucks, but anyways…)

So I have a lot of tag pages where I’d like to insert some different arbitrary text. So, for example, on the World of Warcraft tag page I’d like to insert some info about my toon and link to the WoW Armory section, etc.

One way to do this is to create a new tag.php template for each tag and insert the text there. So, for example, I could copy my normal tag page to tag-world-of-warcraft.php and then insert the tag there. Like I really want to do that for the 200-300 where I’d like to add some text.

And, as far as I can tell, there isn’t any other way to do it. Ideally, it would be nice to have some sort of custom database field that would allow a tag_description-style field, and then php code that could be placed in the tag template that would check to see if a tag_description exists for the given tag and then insert if if it does.

Anyone know of a plugin that can do something like that or some way to do this?

Gallery 2 and WPG

Gallery is a free, open source photo sharing web application which is a bit like saying a Ferrari Enzo is just another car. Gallery 2 pretty much lets the user set up a photo gallery from as simple as a couple pages of photos to as complex as dozen of albums and sub-albums, with dynamic keyword-based albums and other features thrown in for fun. It has options for password protected albums, RSS feeds, a commenting system, etc. There’s no feature I can think of that I really wanted that wasn’t already part of the core system or easily added on through a plugin.

Like WordPress, Gallery benefits from an active community of plugin developers who have extended the features of the software. One of the nicer features for WordPress users is the WPG2 plugin which integrates Gallery with WordPress so, for example, my Gallery pages use the same theme as my WordPress blog and appear to be simply pages under WordPress. Additionally, individual images can be easily inserted into WordPress pages or posts using a special WPG tag.

If you’ve got your own server, Gallery is a cheap and highly flexible way to host a medium to large photo site.