Get a WordPress Category ID

I struggled bus’d pretty hard on this one today. I needed to ignore the “featured” category in a loop, and to do so, WP_Query() requires the category ID. Luckily, I found get_term_by();

 

Author: Greg Rickaby

Greg is Director of Engineering at WebDevStudios and author of a children's book titled, Creating a Website: Design and Build Your First Site!.

One thought on “Get a WordPress Category ID”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.