Adding custom post type through functions

  • 0

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’ )
)
);
}

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’ ) ) ); }

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’ ) ) ); }

Leave a Reply

Your email address will not be published. Required fields are marked *