The following code have to be pasted in your functions.php file. Once the file will be saved, it will work.
As you can see in the code, the post, page, album, movie, quote, and attachment types will be displayed. Modify that line to fit your own needs.
add_filter( ‘pre_get_posts’, ‘my_get_posts’ );
function my_get_posts( $query ) {
if ( is_home() )
$query->set( ‘post_type’, array( ‘post’, ‘page’, ‘album’, ‘movie’, ‘quote’, ‘attachment’ ) );
return $query;
}
Please note that custom post types are not available by default on WordPress 2.9. You could have a look there if you’re looking to implement that functionnality right now.
Credits goes to Justin Tadlock for this handy recipe!
By the way, if you’re looking to advertise on WpRecipes, I got a free spot so be quick! Click here to buy.
Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try…
1979 readersHow to add custom post types to your blog post rotation on your WordPress home (blog/posts) page.
2273 readersWordPress 3.0 is coming soon and one of the biggest new features is the ability to add custom post types. Making these custom post types is pretty easy, here is a simple but complete example of creating a link type custom post.
2504 readersBy now you should be aware that WordPress 3.0 comes shipped with Custom Post Types. It’s a feature that may not be easy to grasp at first, but it holds almost infinite power over what you can do with WordPress. Custom Post Types are not set in stone as to what they exactly are.
439 readersI manage a few blogs that use thumbnail images to spruce up the appearance of the site, and make it more enjoyable for readers. As we’ve discussed here in the past, an efficient method for adding thumbnails to your blog is with custom fields. But finding the right image, resizing it (ugh), uploading, etc., is
176 readersJustin Tadlock has written a nice tutorial on how to show a password form field instead of the default text “There is no excerpt because this is a protected post“. ¶
2371 readersMake Your Theme WordPress 3.0 Compatible A few tips to make your WordPress theme compatible with 3.0 Custom post types in WordPress Justin tadlock has put together a great guide explaining in details the new custom post types introduced with WordPress 3.0
2147 readersWordPress provides several navigational template tags to make it easy for visitors to surf your pages. There are basically two different types of template tags used for chronological post navigation: posts_nav_link() – for navigating various archive (non-single) pages previous_post_link() & next_post_link() – for navigating single-post pages These template tags output the HTML markup required to create the actual
1486 readersWe were working on a WordPress site that needed to display a sticky post at the top of the blog page with one style, and then below it a list of the most recent posts with a completely different style. I realize that you can just style the sticky post using the sticky-related classes provided by
543 readersUsing WordPress' the_excerpt function, or that box that says 'Excerpt' creatively isn't something that too many people do. Why not? Not sure. But maybe that will change - the_excerpt can do so much so easily.
312 readersIt is a well known fact that your regular visitors don't click on your ads. In order to monetize your blog without annoying your loyal readers, what about displaying ads only when posts are older than 15 days?Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for
4,108
Curious what others are searching for? Below are the most popular search terms over the last 30 days.

