synonyms

a minute read
There are times when WordPress developers need category data, especially the ID, while developing themes and plugins. It is not an ideal way, but sometimes, you may need to get the category ID using the Category name. In case you too are in such a situation, here is a quick code snippet to grab the ID of a category by providing the category name. The Function We can utilize the get_term_by() function from WordPress core to get the term ID, the term in this case would be our category. The functio...