So you’ve just completed your upgrade to WordPress 2.x. You’ve installed the latest and greatest versions of your favorite plugins. You’ve lovingly tweaked your favorite theme to within an inch of its life. All is well with the world.

WordPress-powered URLs ending in /search/foo (where “foo” is your search term) now work the same way as the old-school format of index.php?s=foo. They’re cleaner, more intuitive, and darned easier on the eyes.

The only problem? The search form included in most templates produces old-school URLs instead of the newer ones. Thankfully, there’s a simple, elegant workaround using the WordPress WP_Query class.