Monday, July 27, 2015

How to List Categories in WordPress Using the Categories API

In a previous article we saw how to easily work with categories in WordPress. We covered how we can sort our posts into different categories, which can then be edited or deleted.

Having covered the basics, it's now time to have a look at something that will be of more interest to developers: the Categories API, and how to retrieve and display category data.

Like the Links Manager API, the Categories API is a big topic, even bigger in terms of the number of functions available. In this article, we'll be covering one function that is useful when we want to list our categories.

Listing Categories

In the Links Manager API we find an important function that allows us to list our links. It's no surprise therefore that we find the same thing in the Categories API: wp_list_categories(), this is the function we'll work with here.

Basically, you have to call this function in the place you want to see your categories listed.

Continue reading %How to List Categories in WordPress Using the Categories API%


by Jérémy Heleine via SitePoint

No comments:

Post a Comment