Skip to main content
1 of 2
Tanmay Patel
  • 811
  • 1
  • 7
  • 11

Try this code

$post = get_queried_object();
$postType = get_post_type_object(get_post_type($post));
if ($postType) {
    echo esc_html($postType->labels->singular_name);
}
Tanmay Patel
  • 811
  • 1
  • 7
  • 11