First Impressions of Custom Post Type

default custom post type

One of the new very interesting things in WordPress 3.0 are individual post-types you can implement with little effort. Back then, you had to expand the database and write your own interface for it, now you just have to add a few lines of code – of course this is just the current state, which can be change until the final release.
After Justin had been playing with these types, we check out the possibilities of types for “Movies”.
Simple Solution

function post_type_movies() {
register_post_type( 'movies',
array( 'label' => __('Movies'), 'public' => true, 'show_ui' => true ) );
register_taxonomy_for_object_type('post_tag', 'movies');
}
add_action('init', 'post_type_movies');

More parameters for meta-boxes
Of course there are a number of parameters for this function and so the behavior and appearance of the corresponding edit page can be controlled quite easily, a small sample with additional meta boxes:

function post_type_movies() {
register_post_type(
'movies',
array('label' => __('Movies'),
'public'…

You Might Also Like...

  • Taxonomy screen in WordPress

    A refresher on custom taxonomies

    3001 readersCustom taxonomies in WordPress 3.0 are being updated to allow for more control and to give us options we've been waiting nearly a year for.

  • Excerpts and taxonomies for pages in WordPress 2.9

    718 readersHow to make use of a simple file change in WordPress 2.9 to add an excerpt box and custom taxonomy boxes to your page editor.

  • Pop Critics Movie Database

    Using custom taxonomies to create a movie database

    895 readersA tutorial on how I used custom taxonomies in WordPress to build a complete movie database and an explanation of how taxonomies can be used to enhance your site.

  • Taxonomy to post type

    Post types and taxonomies: Linking terms to a specific post

    1127 readersWhen is something both a taxonomy term and post of a specific post type? How do we handle that scenario in WordPress?

  • Rock-Solid WordPress 3.0 Themes using Custom Post Types

    2749 readersThe WordPress community is buzzing with excitement over the soon-to-be-released WordPress 3.0. Currently in Beta 2 now, WordPress 3.0 will have a lot of exciting new features , such as a new default theme and better menu management. Quite possibly the most exciting of these features is custom post types. In this tutorial, we’ll talk

  • 8 useful code snippets to get started with WordPress 3.0

    2228 readersWordPress 3.0, scheduled to launch May 1st, 2010, will be a real revolution for the blogging system. With new functionalities such as custom post types, developers will be able to create more complex and more powerful sites based on WordPress. In this article, I have compiled the most useful resources to get you started with

  • Category Example

    Introducing WordPress 3 Custom Taxonomies

    3030 readersWordPress 3 fills in a number of important gaps towards being a serious content management system. The easy-to-use custom taxonomies function gives site designers some powerful tools for building a good information architecture. Learn what taxonomies are, why they’re useful, and how to use them in today’s tutorial! What is a Taxonomy? Taxonomies are different

  • Add new post with a custom post type

    Custom post types in WordPress

    2979 readersThe ultimate guide for understanding, creating, and using custom post types with WordPress.

  • 10 WordPress 2.8 Features To Look Out For

    233 readers

  • Add categories or tags to post programatically

    2254 readersI recently shown you jow you can create a post or a comment programatically, which is very usefull when creating advanced WOrdPress themes or plugins. Today, let's have a look at another killer snippet: Add categories or tags to a posts, programatically.Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you