How to create a custom post type in Wordpress 3.0
April 19, 2010 by admin · Leave a Comment
Wordpress 2.9 currently have two types of articles: post and pages.
WordPress 3.0 comes with an important novelty: types of articles.
What is so special ?
Suppose you have a music industry news site. With this new organization you can have a section of Albums / disks kept separated from the News section. Or maybe a section with your artists. You cand do that with the following code:
[php]
<pre>$args = array(
'label' => __('Discuri'),
'singular_label' => __('Discuri'),
'public' => true,
'show_ui' => true,
'capability_type' => 'page',
'hierarchical' => false,
'rewrite' => true,
'query_var' => 'discuri',
'supports' => array('title', 'thumbnail')
);
register_post_type( 'discuri' , $args );</pre>
Related posts: