Add a password-protected directory to a WP site

I had a client ask me today if I could set up a secure directory she could use for uploading via FTP some large files needed by another organization. Normally this is a very easy thing to do in cPanel – she’d done it before, years ago – but she couldn’t get it to work now. There’s been a major change since the last time she did it: their site runs in WordPress now. She’s using WP’s ‘pretty permalinks’ feature, which added a few lines to her site’s htaccess file. Those lines were the culprit I was looking for. It’s a pretty easy thing to work around, but it took a bit of google-fu to find the fix:

Credit for the htaccess tweak goes to this guy.

Adventures in WTF/HTML #2

If you call yourself a web designer, or web developer, or really anything that starts with “web,” and yet you code things like the footer I happened across today while fixing a terribly coded site, find another line of work. Seriously. The code in question:

          16151 Puritas Avenue, Cleveland, Ohio 44135     •      Ph. (216) 651-6700     •                                                        Copyright 2011 EMI, Inc

No, I am not kidding.

Adventures in WTF/HTML

I’ve decided it’s high time to introduce a new feature to our code snippet repository. Sure, you might poke through some of the things we’ve come up with and wonder what we were thinking when came up with certain ideas. There’s a learning curve to this stuff, and we don’t all spring from the womb spouting amazing code like Linus Torvalds. It can be really embarrassing to look back at HTML we wrote a dozen years ago, but I can with full confidence claim that even at my most noobish stage I never wrote anything as bad as the crap I come across on a near-daily basis. You see, a lot of the work Joe and I do involves fixing existing WordPress sites or completely tearing down old sites (whether built in WP or not) and starting over again. I’m constantly amazed by the utter ridiculousness of the work turned out by people who claim to be web designers/developers/builders/whatever.

Take this example that we came upon the other day. Mind you, this wasn’t built by some guy using FrontPage 97. This code comes directly from an e-commmerce site built for a multibillion dollar company. We didn’t even have to use anything exotic to fix the code; we used the same tool used by the supposed pros who wrote the site in the first place.

Anyway, to get down to it: if I’m going to enter the title (let’s call it the 1st level heading) in HTML this is how I’ve been coding it:

<h1>Product Name&trade;</h1>

But it turns out I’m wrong. From working on this client’s site I’ve learned the proper way, and I’m sharing it here for your edification:

<p style="margin-bottom: 0in; line-height: 150%;"> <span style="line-height: 150%; color: #404040;">
<span style="font-family: Arial, serif;"><span style="font-size: small;">
<strong>Product Name</strong></span></span></span>
<span style="line-height: 150%; font-family: Arial, serif;"><span style="font-size: small;">TM</span></span></p>

For those keeping score, Product Name is wrapped in three span tags and a strong tag. The trademark is created by wrapping TM in two spans; one to push the text above the baseline, and one to make it small.

Please make a note of it. I expect to see this trend sweep the net by July. You can thank me by sending a 10 pound Excedrin for this headache.