show term description instead of list terms of custom taxonomy

If i understand correctly what you are trying to achieve then you can use get_the_terms function to get the rating terms object and from that echo out the description.

replace:

<?php echo get_the_term_list( $post->ID, 'rating', __('Author Rating: ', 'appz'), ', ', '' ); // HERE I WANT THE DESCRIPTION (I.E. THE IMAGE THAT I USED AS THE DESCRIPTION INSTEAD OF THE TERM) ?>

with:

<?php 
    echo '<span class="rating-author">'.__('Author Rating: ', 'appz').'</span>';

    $reating_terms = get_the_terms ($post->id, 'rating');
    foreach ($reating_terms as $term){
        echo $term->description;
    }
    ?>

Leave a Comment