Tag Archives: plugin_directory

OpenSearch RSS AutoDiscovery for WordPress Searches

I started to compile a “wish list” of WordPress plugins. Turns out, many of my wishes have already come true – it just took a little digging on Google. Too bad there’s not an amazingly comprehensive WordPress plugin directory / wiki (and if there is, nobody really knows about it yet). One of my wishes was for an OpenSearch feed. Turns out Williamsburger already created a plugin, with a WP 2.0 compatible version linked from his comments thread. This got me up and running with my own OpenSearch feed easily enough, but I wanted to have it actually be autodiscoverable within a search query. Without bothering anybody in my personal circle, I found the variables I needed to insert between at the top of my header.php template:

[php]< ?php if (is_search()) { ?>
< link rel="alternate" type="application/rss+xml" title=": < ?=wp_specialchars($s); ?>” href=”http://chris.pirillo.com/os-query?s=< ?=wp_specialchars($s); ?>” />
< ?php } ?>[/php]There you go. An autodiscoverable feed for your WordPress searches! Try a search on my blog for a living example. Couldn’t have gotten it done unless Shayne figured out what I was doing wrong within the .htaccess file. Ugh. I’ve gotta start learning more about Regular Expressions. FUN!