Adding custom post type through functions

add_action( ‘init’, ‘create_posttype’ );
function create_posttype() {
register_post_type( ‘imageslider’,
array(
‘labels’ => array(
‘name’ => __( ‘Image Slider’ ),
‘singular_name’ => __( ‘Image slider’ )
),
‘public’ => true,
‘has_archive’ => true,
‘rewrite’ => array(‘slug’ => ‘imageslider’),
‘supports’ => array( ‘title’, ‘editor’, ‘excerpt’, ‘author’, ‘thumbnail’, ‘comments’, ‘revisions’, ‘custom-fields’ )
)
);
}