add_action( ‘init’, ‘create_post_type’ );
function create_post_type() {
register_post_type( ‘slider’,
array(
‘labels’ => array(
‘name’ => __( ‘Sliders’ ),
‘singular_name’ => __( ‘Slider’ )
),
‘public’ => true,
‘has_archive’ => true,
‘supports’ => array(‘title’, ‘thumbnail’),
)
);
}
- ‘title’
- ‘editor’ (content)
- ‘author’
- ‘thumbnail’ (featured image) (current theme must also support Post Thumbnails)
- ‘excerpt’
- ‘trackbacks’
- ‘custom-fields’ (see Custom_Fields, aka meta-data)
- ‘comments’ (also will see comment count balloon on edit screen)
- ‘revisions’ (will store revisions)
- ‘page-attributes’ (template and menu order) (hierarchical must be true)
- ‘post-formats’ (see Post_Formats)