How to get all categories of a current post on WordPress

If you are trying to display all categories of a post in WordPress, you may encounter a problem. As the standard

get_the_category()

only allows you to grab the primary category, i.e. it will only display one category. This is not very useful in post listing or a single post page where you want to list all the categories that are tagged to this post (or each post).

There are actually many ways to pull out all the categories of a particular post, but one of the simplest ways that we at Oangle prefer, is this:

Paste this code wherever you want to list the categories, and make sure to embellish the code with your own styling or formatting elements. Our example provided offers an a tag and makes the categories clickable to each category archive upon click.

Unsure of where to insert this? Don’t want to break anything? Our team of WordPress developers in Singapore can accomplish this job for you safely and efficiently. We are highly experienced in WordPress and web development and are equipped in solving any issues you might be facing.

oangledes

Recent Posts

Behind the Build: How We Brought Paragon Capital Management’s Website to Life

At our agency, we don’t just design websites — we craft digital experiences that solve…

1 week ago

Responsive Design Isn’t Just for Mobile: Why Breakpoints Matter

Responsive design is the practice of building websites that adapt gracefully to a wide range…

2 weeks ago

Mobile-First Isn’t Optional: Here’s How to Design With It in Mind

In the past two decades, the way people access the internet has undergone a dramatic…

3 weeks ago

Meta Tags, Headings & Keywords: The SEO Basics That Still Matter

Meta tags, headings, and keywords are foundational to effective website development and play a significant…

1 month ago

Why WordPress Is Still the Best CMS for Small to Medium Businesses

Among the many options available today, WordPress continues to stand out as the most reliable,…

1 month ago

The Psychology Behind Button Design: How Shape, Color, Icon and Text Influence Clicks

Buttons are more than mere functional elements. Understanding the psychological principles behind button design can…

2 months ago