A pair of scripts that make it easier to manage the development of a WordPress plugin in Github, and then periodically deploy to the WP.org plugin repo (SVN).
I’ve long wanted to be able to do some simple, operated-powered searches within WordPress (especially relevant in a project I’m working on at Automattic). After a conversation with Allen, where he wanted to do the same thing, I figured I’d just whip up a quick plugin to see how hard it’d be. Turns out the answer is “not very”.
Simple Search Operators is a quick plugin that expands the functionality of the default search system in WordPress so that you can use a few useful operators (might look at adding some more at some point) [all links in the following list go to live searches on this site, using that operator]:
author:beauwill limit results to posts written by the author with the username/slug ‘beau’
tag:burritowill only return posts which are tagged with ‘burrito’
cat:posts) to search for posts categorized as ‘posts’
tag:burritofriday cancun author:beauto search for posts containing ‘cancun’, written by ‘beau’, tagged as ‘burritofriday’
- Not heavily tested! May well be capable of generating server-melting queries
- Only supports one of each operator for now
- Operators and freeform searches may be combined (e.g.: “tag:burrito cancun”)
- Does not support spaced strings for operators, so you can only do things where a no-space string attached to an operator will get you what you want
- Because of the way it manipulates query variables, might mess with other plugins or themes in adverse ways. Like I said, not heavily tested.
- Not available via the WP Plugin Repo yet; will get it up there once it’s baked a little bit
If you’d like to give it a shot, please do. If you’d like to add more operators; shoot me a pull request and we can expand this out a bit.
One thing that’s always bugged me in writing Posts/Pages content within WordPress is that you have to cater for different presentation possibilities. If you’re into web-standards, then that makes life difficult for things like headings (
h2, etc), when a block of content is presented in different contexts.
Ideally, your page should be structured with an
h1 tag around the title of the most important concept on the page, an
h2 around a sub-topic/concept, etc. On your home page, the
h1 usually ends up going around your logo/site title, since that’s the over-arching concept. Then under that, you might have a listing of recent posts. Each of those posts should probably have their titles in an
h2. No problem so far, right? You just set up your template like that and you’re good to go. (more…)