How to add custom post type thumbnail in WordPress

1. Add code in finctions.php file.

add_theme_support( 'post-thumbnails', array( 'post', 'page', 'movie', 'product', 'artist');

2. Then add Custom Post Type

add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'artist',
array(
'labels' => array(
'name' => __( 'Artists' ),
'singular_name' => __( 'Artist' )
),
'public' => true,
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),
)
);
}

Leave a Reply

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