Use this code snippet to display the first category of a WordPress post. <?php $smello = (array) get_the_category($post_ID])[0]; echo $smello[‘cat_name’]; ?> where $post_ID is the ID of the post whose category is required. Change [0] to [1] to get the…