Hi,
I have used a function to create a post type but the featured image does not appear in the editor. Could you please help me with this?
Here is the code used to create the post type:
// Register Custom Post Types
add_action(‘init’, ‘register_custom_posts_init’);
function register_custom_posts_init() {
// Register Members
$members_labels = array(
‘name’ => ‘Members’,
‘singular_name’ => ‘Member’,
‘add_new’ => ‘Add New’,
‘add_new_item’ => ‘Add New Member’,
‘edit_item’ => ‘Edit Member’,
‘new_item’ => ‘New Member’,
‘all_items’ => ‘All Members’,
‘view_item’ => ‘View Member’,
‘search_items’ => ‘Search Members’,
‘not_found’ => ‘No members found’,
‘not_found_in_trash’ => ‘No members found in the Trash’,
‘parent_item_colon’ => ”,
‘menu_name’ => ‘POD Members’
);
$members_args = array(
‘labels’ => $members_labels,
‘public’ => true,
‘capability_type’ => ‘post’,
‘has_archive’ => true,
‘supports’ => array( ‘title’, ‘editor’, ‘excerpt’, ‘thumbnail’, ‘revisions’ )
);
register_post_type(‘members’, $members_args);
}
Hey ihtezaz,
I think this part of the code should add it:
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'revisions' )
Can you try to replace all your single quotes, just retype it since it might be the cause why it’s not working.
Another workaround for this is to use this plugin Custom Post Types UI: https://wordpress.org/plugins/custom-post-type-ui/
It has all the options you need.
Best regards,
Nikko
Hi Nikko,
Thanks for that!
May just stick to the plugin.
Hi ihtezaz,
Glad that we could help :)
Thanks for using Enfold and have a great day!
Best regards,
Nikko