How to Display Post related Category Names


How to Display  Post related Category Names

<?php if ( is_object_in_taxonomy( get_post_type(), 'category' ) ) : // Hide category text when not supported ?>
            <?php
                /* translators: used between list items, there is a space after the comma */
                $categories_list = get_the_category_list( __( ', ', 'theme' ) );
                if ( $categories_list ):
            ?>
            <h4>
                <?php printf( __( '%2$s', 'theme' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list);
                  ?>
            </h4>
<?php endif; // End if categories ?>
 <?php endif; // End if is_object_in_taxonomy( get_post_type(), 'category' ) ?>