Entries Tagged 'WordPress' ↓

iWPhone: The Easy Way to Optimize WordPress for iPhones

HWD on an iWPhone-optimized iPhoneWhile preparing for a meeting on designing for the mobile web, the old memory banks suddenly kicked in, and I remembered there was some tool that made it a breeze to optimize WordPress for iPhones. Since I’m on an iPhone tear, I took the time to research it.

Sure enough. There are quite a number of promising plug-ins, in particular ContentRobot’s iWPhone. It’s a nifty skin for WordPress that doesn’t alter your blog on computer screens — only on iPhones. Even better, it only took me three minutes start-to-finish to get it working.

Of course, being me, I couldn’t leave it at that. I had to personalize it for this very blog. The default is blue, and I’m getting a tad sick of blue and gray sites for the iPhone. (Drab blue and drab gray. Sounds like the Civil War to me.) I changed the colors to red and yellow and added one 4KB GIF, which doesn’t slow things down appreciably. Beyond that, I went into header.php, and added links for the archives and about page.

In truth, I’ve been hovering on the edge (so to speak) of true iPhone design, but this was my first real foray into it — and it was a blast.


How to Remove Microsoft Formatting From WordPress Posts

This is a tip for my long-suffering friends who are so good about updating the various blogs I’ve set up. I just knew there had to be a better way. Better late than never, right?

Oh my heavens. It turns out it’s really easy to strip Microsoft Word and other blog-breaking formats out of WordPress. It only takes three clicks. Here’s how.

How to open the paste to plain text icon

Step 1. In the Word-like tool bar for the “Post” field, at the right end there is a mysterious square icon with dots. (See the picture above.) Click it. A second row of icons magically appears.

Step 2. In the middle of this second row is an icon of a yellow folder (I think) with a T on top. Click it and a “Paste as Plain Text” dialog box pops up.

Step 3. You guessed it. Paste your text in this dialog box and click the insert button in the lower left.

That’s all there is to it. No more weird looking blog posts. No more broken home page. (Or at least it will reduce such things.)

WordPress Tips When Using Secured MySQL

When you use secured MySQL for your database, like Vanderbilt ITS servers, installing WordPress causes one peculiar problem that can be a pain to debug. Or at least it was for me. I couldn’t find any documentation anywhere. Fortunately, one of the ITS server admins had alerted me that the standard php mysql_connect function needs fine-tuning to connect to their server, and I guessed that was the issue with WordPress. Specifically you need to add the MYSQL_CLIENT_SSL constant at the end.

In WordPress, the file you have to update is wp-db.php in the wp-includes includes folder. As of today it’s found on line 69. Find the line that reads:

$this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword);

Replace it with:

$this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword, true, MYSQL_CLIENT_SSL);

That’s all there is to it.

But as long as I’m blogging about this, I thought I’d give those of you having to upgrade WordPress my list of things to do. (I wrote it down so I don’t have to rethink it with every upgrade.)

Upgrading WordPress With a Secured MySQL Server

  1. Download and unzip the latest upgrade.
  2. Rename your current blog folder (local side) something like blog.old. Put the newly downloaded and unpacked folder in its place (being sure to rename it as needed).
  3. Review the readme file. Assuming upgrade instructions are the same as always, in the new folder….
  4. Copy your old wp-config.php
  5. Copy your old wp-content/plugins
  6. Copy your old wp-content/themes/
  7. Edit wp-includes/wp-db.php (see above)
  8. Continue following the readme instructions, which usually means uploading the new files and pointing your browser to /wp-admin/upgrade.php

One last step: thank Vanderbilt ITS for their help and support with this kind of work. They rock.

Choosing a WordPress Theme

I toyed with the idea of using Drupal for this blog, but then I came to my senses. At this point I’ve developed over a dozen not just blogs, but WordPress blogs, plus my host, Dreamhost, makes the inevitable periodic upgrades a cinch. It’s just point and click.

Choosing a theme, however, was less obvious. In the end, after a bit of window-shopping at sites like Smashing Magazine, I went with adapting the very handsome CopyBlogger theme. It wasn’t so much the looks (though I do like the clean lines) as the way it renders the code. It has a good reputation for semantic markup and search engine optimization. See, for example, this review.

I’m still not quite satisfied with my adaptation, but it’s getting there. And it was very easy to do. My only suggestion for others wanting to use it would be to delete the separate call for “custom.css” (line 12 of header.php) and just edit the style.css. It’s there to protect the layout cross-browser, but it you’re used to CSS, you won’t need this, and deleting this second stylesheet saves both confusion and at least a little bit of bandwidth.