WordPress show category name

We Are Professional

WordPress show category name

To display the name of the first category:

<?php $cat = get_the_category(); echo $cat[0]->cat_name; ?>

0 displays the first category, so 1 will display the second category, 2 will display the third category, and so on.

To display a list of links to each category:

<?php the_category(', '); ?>

The comma ', ' serves as a separator when the post is included in more than one category.

Actually, Categories provide a simple solution for grouping similar articles together. They help the users find related content, and when used correctly, categories can help you in SEO.

Moreover, You can use <?php the_category(', '); ?>

which would output them in a comma separated list.

You can also do the same for tags as well:

<?php the_category(', '); ?>


WebinBangla is a leading web solution provider and we work globally. Wel make sure our clients and customers avail maximum benefits by using our high quality services and complete packages.

  • Address: Pahartoli, Raozan, Chittagong.
  • Email: mamun005cse@gmail.com
  • Phone: +880 1738 914871

Working Hours

  • Monday - Friday - 9am to 5pm
  • Saturday - 9am to 2pm
  • Sunday - Closed