wordpress print all categories 1

wordpress print all categories

$categories = get_categories();
foreach($categories as $category) {
   echo '';
}

Here is what the above code is Doing:
1. We’re using the get_categories() function to get all the categories.
2. We’re looping through each category and displaying the name and link to the category.

Similar Posts