New Plugin: WP-Asides
This isn’t so much a downloadable plugin as a feature writeup. For a long time I’ve been looking for a good way to do asides in Wordpress, so I decided to start writing a plugin. The way Asides work in Wordpress, you choose a category you want to publish in a seperate column, and then exclude all the posts from that category from the home page. The best way (in 2.xx) to do this is to use the post_where and post_join filters to tack onto the main SQL query, like so:
function ea_where($query) {
global $wpdb;
if(is_home() || is_feed())
return $query . ‘ AND category_id != ‘ . get_option(‘ea_category’) . ‘ ‘;
else
return $query;
}function ea_join($query) {
global $wpdb;if(is_home() || is_feed())
return $query . ” LEFT JOIN $wpdb->post2cat ON ($wpdb->posts.ID = $wpdb->post2cat.post_id) “;
else
return $query;
}
The whole WP-Asides presentation ends up looking something like this:

Every 5 seconds the old aside fades out (with a little AJAX and scriptaculous) and a new one fades in. You can check out it in action at the top of this blog’s index page.
Now, the reason I’m not releasing this as a Wordpress plugin is that it adds a nice, exclusive feature to my network of blogs, and that it’s pretty easy to make. Call a few wordpress functions, sprinkle in AJAX and scriptaculous effects, design a little CSS and imaging, and you have a cute asides solution!
| This entry was posted on Monday, June 19th, 2006 at 11:34 am and is tagged with nbsp nbsp nbsp nbsp nbsp, query function, category id, sql query, writeup, fades, ajax, scriptaculous, wordpress plugin, index page, ea, wp, long time, blogs, blog. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback. |


“The plugin technique is proprietary.”
Lame.
The plugin technique is proprietary. However, this bit of code is one you’d insert in a plugin to redirect a given category using the add_filter function and the two filters mentioned in the post.
Can you be little more clear on where to put this in?
Or your being ambiguous because you don’t want others to have it?
Great job, thanks for the ideas! I got the actual ticker working, now I’m making the wp plug in.
Disappointed that you won’t share the code with everyone since I’ve loved your previous plugins.
Looks great though.
Looks really good. It will surely grab visitors attention. Nice Plugin. Thanks for sharing it with us
Hi, your asides look nice, I’m interested in some more details about the functions you have described. I don’t know much PHP yet so its not clear to me exactly what they do and where/how I should call them… any more clues I would be grateful
hi Elloitt, this plugin is really cool. i was trying to follow the way you did it but i cannot succeed. I’m wondering if you can send me the plugin straight.
Looks very good, nice and neat!
You need to fix your link, you spelt Elliott with one T.