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

How Design, Development, and SEO Work Together to Boost Your Business

In today’s competitive digital marketplace, online visibility is everything.

6 days ago

Keeping Your Website Secure and Up-to-Date Behind the Scenes

The most important parts of your website aren’t always visible. Behind every smooth user experience…

2 weeks ago

Do I Really Need a Website Redesign? 5 Signs It’s Time

Your website is the digital face of your business. Below are five clear signs that…

3 weeks ago

Why Your Website Feels Slow (and What to Do About It)

If your website feels sluggish, the issue likely runs deeper than just large images or…

4 weeks ago

Websites as Marketing Tools: Design with Strategy in Mind

In today’s digital-first economy, your website isn’t just an online brochure — it’s your most…

1 month ago

Designing for Humans: Should UI or UX Come First?

When starting a new digital project, one of the first strategic decisions teams face is…

1 month ago