At work a few months ago, I needed a lightweight “News” feature for a site we were developing. The news articles needed to behave just like regular blog posts, in that they should have a news archive page in reverse chronological order. I also needed a widget that would display the latest news items in a sidebar. Rather than using just a category to exclude or include posts based on context, I elected to make a simple plugin that would add a News custom post type (CPT) through a plugin. That’s how the News-CPT plugin was born.
This approach has a couple of big advantages over other methods. Using a custom post type instead of a category means that I don’t have to filter the News articles from regular lists post, like on the homepage, and in recent posts lists in sidebars. Adding the custom post type through a plugin means that you can change themes without having to remember to copy the CPT code from one themes’s files to another. Once you activate the plugin, the News post type will remain available, no matter how many themes you try.
The plugin also supplies basic single-news.php and archive-news.php templates to get you started styling those pages. All you have to do to customize those pages is make copies of those pages into your theme’s directory and modify them to your heart’s content. The plugin will use your customized template files first, and only fall back on its basic files if a custom version doesn’t exist in your theme folder.
You can download my plugin from the WordPress plugin repository at http://wordpress.org/plugins/news-cpt/. There is more complete documentation there.