Return to Snippet

Revision: 32796
at October 2, 2010 06:00 by raspo


Initial Code
$my_cat_name = "news";

$my_cat_id = get_term_by('name', $my_cat_name, 'category')->term_id;

echo $my_cat_id; //1

Initial URL

                                

Initial Description

                                

Initial Title
Wordpress: Get category ID from category name

Initial Tags
wordpress, category

Initial Language
PHP