I recently setup The Events Calendar WordPress plugin on a few sites for work. The events are added as posts, so they show up in the WordPress RSS feed.
We didn’t want events showing in the RSS feed, this is the code I ended up with:
// Keep events out of RSS
add_filter('pre_get_posts', 'exclude_category_from_feed');
function exclude_category_from_feed($query) {
if ($query->is_feed) {
$query->set('cat','-'.get_cat_ID( 'Events' ));
}
return $query;
}
Adding that bit of code to the functions.php file for your theme will prevent posts in the “Events” category from appearing in your RSS feed. You can obviously change “Events” to whatever category you want to exclude.
It can be extended too, not just limited to keeping a category out of the RSS feed. For example, to keep a category off the home page or archive pages, you can change this:
So, I wrote this little thing a couple days ago. I was browsing on Geocaching.com and wanted to decode some of the hints. I found a few ROT13 decoders online, but wanted to write one of my own.
Much to my dismay, I learned geocaching.com has a built-in “decode” link right next to the encoded hints. I didn’t learn about this until about 10 minutes after I had finished writing the Geocaching Hint Encoder/Decoder. Thankfully, I didn’t have more than 20 minutes of work into it, so no big deal.
Not a whole lot has changed since 1.5.3, but the changes that were made are significant. Unwakeable 1.5.5 is compatible with WordPress 3.1.
The most notable change is the removal of title.gif file. That was the image file with “Unwakeable” written on it that sat in the top left corner. Instead of that image, text is now used. The name of the WordPress site is pulled and used in place of the image. You can see a demo over at the Unwakeable demo site.
I’ve also added support for custom menus that were introduced in WordPress 3.0. By default, the top menu is a list of pages. If you want to use a custom menu just set one up in your WordPress dashboard (Appearance –> Menus) and set that menu as the “primary navigation”.
My goal with this release of Unwakeable was to get it included in the WordPress theme directory. It’s still pending approval or rejection in the theme directory. If it’s rejected I’ll make the necessary changes, bump the version number, and submit it again.
If you’re interested in the exact changes that were made in Unwakeable 1.5.5, have a look at the following revisions in subversion: r131 r132 r133 r134
The latest revision is r135 but that was just to tag the 1.5.5 release in subversion.
If you have problems or find something broken, please submit an issue on Github and I’ll look into it.
I’ve been using this WordPress page template lately for creating a directory page. The directory page lists every blog on a WordPress 3.0 multi-site setup and includes the author name, author bio, number of posts, last updated time, and gravatar. One thing it DOES NOT include is recent posts. I will get around to adding that in a few weeks. It also lists the 5 most recent posts for each blog.
I like using the 1kb css grid system for laying pages out, so you can see what I use for css in the zip file. If you want to roll with that setup, you can just copy and paste the contents of css.css into the style.css file for your theme. And move sign.png into the images/ folder for your theme. You’ll also want to do something with the blog-directory.php file.
blog-directory.php is a custom page template for Twenty Ten. If you’re using the Twenty Ten theme, you can just drop blog-directory.php into the “twentyten” theme folder and be done. If you’re using another theme you’ll need to open blog-directory.php and copy everything between <!– start blog directory –> and <!– end blog directory –> and paste it into a custom template for your theme.
If you’re not familiar with custom page templates in WordPress, you can read about them here.