Em um loop:

switch ( get_post_type() ) {
  case 'post':
    $post_cats = wp_get_post_terms( get_the_ID(), 'category' );
    if ( $post_cats ) {
      $section_title = $post_cats[0]->name;
    }
    break;
  default:
    $section_title = get_post_type_object( get_post_type() )->labels->name;
}

Com o post em uma variável:

switch ( $the_post->post_type ) {
  case 'post':
    $post_cats = wp_get_post_terms( $the_post->ID, 'category' );
    if ( $post_cats ) {
      $section_title = $post_cats[0]->name;
    }
    break;
  default:
    $section_title = get_post_type_object( $the_post->post_type )->labels->name;
}