In the continuing effort to get the blog cleaned up and looking more presentable, as well as with the advent of the use of tags to offer a different organizational scheme for the music-blog component I’m trying to break in right now, I noticed and error.
The title of the page which listed all posts with a (tag) was all garbled:
“::Schrödinger’s Blog:: >> (tag)Category Archive for (tag) Archive”
Where (tag) was the name of the tag; we’re using it for the artist’s name. I’ve never had issues with our title code before, and I’ve been putting off fixing it since we started using them just a little over a week ago. Tonight I bit the bullet and began to try and decipher why this thing was acting so stupid. What our title code looked like was this:
<?php bloginfo('name'); ?>
<?php wp_title( );
if (function_exists('is_tag') and is_tag()) { ?>Category Archive for <?php echo $tag; }
if (is_archive()) { ?> Archive<?php } elseif (is_search()) { ?> Search for <?php echo $s; }
if ( !(is_404()) and (is_search()) or (is_single()) or (is_page()) or (function_exists('is_tag') and is_tag()) or (is_archive()) ) { ?> <?php } ?>
<?php bloginfo('description'); ?>
The big ugly thing in the middle is the important part. The long story shortened is that I found out that ‘function_exists(‘ ‘)’ actually calls for a plugin. In my case, it was calling for a plugin called ‘is_tag’. Um, OK? Kinda weird given I’ve never heard of that thing, much less installed it; why would I call it in the code?
Well, turns out that the tutorial I used to build my theme, just over two years ago during the Great and Final GreyMatter Crash, just had you arbitrarily insert that chunk of code. Which is fair, given that I’d have no idea how to write code like that just jumping into WordPress cold… but why the random plugin? I looked it up: it makes sense, given the function, but the tutorial never prompts you to download it…
Anyways. That’s fixed! Turns out just blasting that first ‘if’ argument fixes the whole thing! So, check off the list. I also rigged the year to automatically roll over down in the faux copyright, so no more of that awkward January-February time when I forget to update it, and everyone just kinda bites their lips and goes “Um, Tom, I don’t know how to tell you this…”
You might have also noticed that I’m working to slip in direct links to all of the posted mp3s. They look kinda like this: [ mp3 ♫ ], except the actual one is a link. I left the embedded player in because I feel that it is classy as hell, coordinating with our color scheme and whatnot (which took time to do, by the way). But those direct links are needed if we’re ever gonna get aggregated on Hype, so there they are. Also I guess you could download the file if you wanted, but I can’t really support that from a legal standpoint, blah blah blah.
(If the Unicode music note doesn’t show up for anyone, let me know. It shouldn’t be like a weird proprietary thing, but if it comes up as nonsense I want somebody to tell me.)
Still on the list:
New Banners – [when I get home]
Comment Form – [has always sucked and now has these strange little blank avatars since I don’t even know when. I’m just gonna get rid of them.]