Your browser is not supported.

This website is optimized to work in modern browsers like Safari 3+, Firefox 4+, Chrome 10+ and IE9+. If you are using a different browser, you may experience visual glitches or other problems.

Posts tagged with WordPress

A change is gonna come

Faithful readers (all two of you) will know that I haven’t been updating my site with great regularity in the past months, but that’s all going to change soon.

With the recent release of WordPress 3.0, I’ve been spending a lot of time playing with the new custom post types feature, and I’ve gotta say that I’m pretty excited about it.

For those who want to use WP as a GUI to create arbitrary objects, tables and URLs in a relational manner—as you would with a web application framework like Rails or Django—you’re still better off using something like Pods CMS. However, in case that you want to use WP more like a traditional CMS, where the primary content still consists of text-based posts, WP 3.0 is the answer for your needs.

In the coming weeks, I plan to overhaul my web presence:

  • I’m consolidating all my 5 sites into 1 (this one, since it’s the most actively read and maintained).
  • Part of that consolidation will be putting together all the reviews I write (books, music, movies, software) in a single, cohesive format (read: custom post type) that will make them easier to find and browse. That is, depending upon whether I can find some way to batch-convert existing posts into the new post type.
  • I’m also going to introduce a lighter form of post, in the tradition of Tumblr and Daring Fireball. These tumbles will be interspersed with my regular posts, and will hopefully make it easier for me to share links and easier for you to browse to them—by clicking on the title rather than hunting around inside the post to find them. You can see an example of my first tumble below (Aaaaarrrgggggghhhhh!), where you’ll notice a (this is the technical term) tumble-y icon off to the right, that will provide the permalink for easier, er, re-tumbling.

Lessons learned: the WordPress 2.5 media upload problem

If you have WordPress 2.5, chances are you’ve run across the media upload problem. As for me, I didn’t so much run across it as into it. At 100 miles an hour.

A brief background on the problem: it’s not that uploads don’t work at all, but that the asynchronous Flash uploader doesn’t work—in fact, you can disable the Flash Uploader and go back to the old one-at-a-time upload method if nothing else works for you. Every time you try to upload a file or batch of files, you get the nondescriptive “http error” message and the file upload fails. Most of the time this is caused by a configuration problem on your webserver.

Now, for most people a workaround listed on the official WP support topic will fix the issue. But—wait for it—not me. I’d been breaking my head against the problem for the better part of two full days before finally getting the Flash uploader working just a little while ago.

I won’t bore you with the troubleshooting details, but my problem wasn’t that the mod_security module was causing a problem, or that my uploads folder didn’t have the right ownership/privileges. It was the fact that the entire WP installation was protected by HTTP authentication such that only a few users on our work server could access it. Since Flash is entirely incapable of authenticating uploads, all attempted file uploads were failing.

Specifically, two files in the WP installation were getting 401 Authentication Required errors: wp-admin/async-upload.php and wp-admin/admin-ajax.php. To fix this problem, you need to (in addition to disabling auth for the wp-content/uploads folder) add the following lines to an htaccess file in the wp-admin directory:

# Disable HTTP authentication for Flash uploads
<FilesMatch "(async-upload|admin-ajax).php">
  Allow from all
  Satisfy Any
</FilesMatch>

This solution, of course, assumes that your webserver allows htaccess file overrides.

I've just spent some time

making changes to the category structure on this blog. I had previously been using the categories somewhat like tags, but it was clunky at best. Now that WordPress 2.3 has introduced the new tagging feature, I’ve removed all subcategories and made the category structure a flat one (though that may change as I rethink my post organization), and used tags to replace those subcategories.

Unfortunately, idiot that I am, I did this all manually, instead of using WP’s handy-dandy categories-to-tags feature. This would have saved me hours. God.

There's every chance

that no one will be as excited about this as I am, but I’ve just rewritten my theme to take advantage of the sidebar widgets plugin. What does this mean? It means that I’ve made my sidebar dynamic, such that I can drag-and-drop different sections onto or off of my sidebar, reorder them, etc. without actually having to touch the code. If that wasn’t cool enough, now I can also use other people’s widgets on my site. Nice.

Some improvements

Most of this is under the hood, but I’ve made some changes to this blog to improve your experience:

  • I spent some time just now adding new categories, and re-categorizing posts more meaningfully. There should now be no posts marked “Uncategorized”.
  • I’ve added a “Most commented posts” section (thanks to this plugin) to the sidebar, so you can see what I’ve written that people seem to get most exercised about.
  • Commenting improved! I’ve added plugins to show users a live preview of their comments, and also given them the ability to edit comments they’ve posted for a fixed time after the posting.

Attention WordPress 2.0.3 users:

I’ve found a bug. I looked briefly on trac and the WP forums, and couldn’t find any mention of it, so I posted a message asking about it. The gist of it:

I recently upgraded from WP 2.0.2 to 2.0.3 and noticed a problem. If I add a link or comment with apostrophes or quotes to WP, it gets added to the database properly and displayed properly. However, if I then edit the link or comment and save it, the data in the database suddenly contains escape characters (backslashes) before all the single and double quotes, and these backslashes can’t be removed by editing again. You have to go into the database (in my case, I used phpMyAdmin) to manually edit the entries to remove the erroneous backslashes. I am not too familiar with the WP code, but I’m guessing that the problem lies in the save-after-edit functionality.

Like I said, I looked briefly, so if anyone knows of this topic already being raised to the WP developer team, please do let me know.