display question’s category by question id

Solved1.99K viewsGeneral
0

Hi, I would like to display the category next to the single-question list item.  Is there coding that can display the question’s category by question id?
Thanks.

Question is closed for new answers.
Selected answer as best
0

My solution is adding this:

<?php
   global $metas;
   if ( ap_post_have_terms( $question_id ) ) {
   $metas['categories'] = ap_question_categories_html(array( 'label' => '<span class="ap-category"></span>'));
   echo($metas['categories']);
   }

Selected answer as best