Web Development WordPress

How to Get Yoast’s Primary Category

Displaying WordPress categories in a theme can be a challenge because a post could belong to several different categories and if the theme has to display 30 categories for each post in a list, it could get messy. This is where a primary category comes in handy.