I am an amateur and I am trying to edit a theme that I have bought and I am not able to display the category name and link. Does anyone to resolve this problem.

<div class="item-info">';
                            $author = get_author_posts_url( get_the_author_meta( 'ID' ) );
                          $html .= '<span  class="item-author"><a href="'.$author.'" title="'.get_the_author().'">'.get_the_author().'</a></span>';}

                           //DISPLAY CATEGORY LINK AND NAME
                            $subaut = get_the_category();
                          $html .= '<span  class="item-sub-aut"><a href="'.$subaut.'" title="'.get_category_link().'">'.get_category_link().'</a></span>';}

                          $html .= '<span class="item-date">'.get_the_time(get_option('date_format')).'</span>';}
                          $html .= '<div class="item-meta no-bg">';
                          if($show_view!='0' ){
                          $html .= tm_html_video_meta('view',false,false);}
                          if($show_com!='0' ){
                          $html .= tm_html_video_meta('comment',false,false);}
                          $html .= tm_html_video_meta('like',false,false);}
                          $html .= '</div>

The wordpress docs for get_the_category says:
"Note: This function only returns results from the default “category” taxonomy. For custom taxonomies use get_the_terms()."

So you might want to try that as an alternative. Otherwise, after the call to get_the_category, add:
var_dump($subaut); die();
This will kill the page generation (die) but dump out the result of the method call onto the screen. You can then check that it is something rather than nothing.
The result of get_the_category is an array rather than an actual category name so
<a href="'.$subaut.'"
won't work anyway as $subaut isn't a string of text that can be placed into an anchor link. It might be something like $subaut->name instead. Again, looking at the dumped result should make it apparent what part of $subaut you actually need.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.