Try this:
$cats = get_terms('category','hide-empty=0&orderby=id');
foreach ( $cats as $cat ) {
echo "ID:$cat->term_id NAME:$cat->name SLUG:$cat->slug <br />";
}
Hi there,
Thank you for the response!
Can you please tell me where I can put the code, so that I can get the results, but it won’t be visible to visitors of my blog site?
Thank you.
If you don’t need an actual list, you can add the ID column to the Admin->Posts->Categories screen just by installing the WP Show IDs plugin.
Oh that is great! I just installed the plug-in, and it reveals all the category IDs. Perfect! Thank you! 🙂
I kind of wanted to generate a list, but, with that plug-in, I can easily, and quickly, create my own list.
If your problem has been solved, please use the dropdown on the right to mark this topic ‘Resolved’ so that anyone else with this question can see that there is a solution.
Yes, I think that will do it.
Thank you again!
Mark