WordPress Plugin to Regenerate Thumbnails

The other day I realized I had accidentally set thumbnail generation in WordPress to be exactly 150×150 even when that wasn’t a proportional resizing of the larger graphic. Ugh. I reset the pref to the proportional setting, but what to do about the existing thumbnails?

Well, this is WordPress so you have to use a plugin for everything, and it turned out there’s a nice Regenerate Thumbnails plugin that will let you resize all thumbnails after changing the preferences. Worked like a charm for me.

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)) { ?>
<?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?