I copied this code from a youtuber. It works for him, but not for me. Does the code contain any errors? As soon as I put it in, my WordPress breaks and won’t load.
function gt_custom_post_type() {
register_post_type('project',
array(
'rewrite' => array('slug' => 'projects'),
'labels' => array(
'name' => 'Projects'
'singular_name' => 'Project',
'add_new_item' => 'Add New Project',
'edit_item' => 'Edit Project'
),
'menu-icon' => 'dashicons-media-document',
'public' => true,
'has_archive' => true,
'supports' => array(
'title', 'thumnail', 'editor', 'excerpt', 'comments'
)
)
);
}
add_action('init', 'gt_custom_post_type');