I can’t get the “featured image” to show up in the editor. This is in features.php. When I go to the admin backend, end edit the CPT, I get the regular edit screen without a featured image. I thought supports thumbnail was the way to go.
function createStyleWiseCPT() {
$labels = array(
'name' => _x( 'Style Wise', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Style Wise', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Style Wise', 'text_domain' ),
'name_admin_bar' => __( 'Style Wise', 'text_domain' ),
'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),
'all_items' => __( 'All Style Questions', 'text_domain' ),
'add_new_item' => __( 'Add New Style Question', 'text_domain' ),
'add_new' => __( 'Add New Style Question', 'text_domain' ),
'new_item' => __( 'New Style Question', 'text_domain' ),
'edit_item' => __( 'Edit Style Question', 'text_domain' ),
'update_item' => __( 'Update Style Question', 'text_domain' ),
'view_item' => __( 'View Style Question', 'text_domain' ),
'search_items' => __( 'Search Style Question', 'text_domain' ),
'not_found' => __( ' Style Question Not found', 'text_domain' ),
'not_found_in_trash' => __( ' Style Question Not found in Trash', 'text_domain' ),
);
$args = array(
'label' => __( 'style-wise', 'text_domain' ),
'description' => __( 'A styleish post', 'text_domain' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats', ),
'taxonomies' => array( 'style-wise' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'style-wise', $args );
}
try to add this in function
you can also check the codex for reference