WordPress doesn't recognize my custom taxonomy
-
Hello everybody.
I’m using WordPress 3.0.1 …
I created a Custom Post Type named “Products” and a Custom Taxonomy named “Catalog”.Apparently everything works on the control panel. I see my new menu,
add items to my catalog, all right.It seems that WordPress is not recognizing my new taxonomy.
taxonomy_exists ('catalog')
is returningfalse
.When attempting to list the items in this new category (taxonomy), I get an error:
$terms = get_terms ('catalog', 'hide_empty = 0'); print_r ($terms);
WP_Error Object ([errors] => Array ([invalid_taxonomy] => Array ([0] => Invalid Taxonomy)) [error_data] => Array ())
Code I’m using to create the new taxonomy:
add_action('init', 'new_taxonomies', 50); function new_taxonomies() ( $labels = array( 'name' => __('Product Categories'), 'singular_name' => __('Product Category'), 'search_items' => __('Search category'), 'popular_items' => __('Popular category'), 'all_items' => __('All Categories'), 'parent_item' => __('Parent Category'), 'parent_item_colon' => __('Parent Category:'), 'edit_item' => __('Edit category'), 'update_item' => __('Update Category'), 'add_new_item' => __('Add new category'), 'new_item_name' => __('New category name') ); register_taxonomy('catalog', array('shop'), array( 'hierarchical' => true, 'labels' => $labels, / / SEE this is the array $labels from above 'show_ui' => true, 'query_var' => true, 'rewrite' => array ('slug' => 'catalog') )); )
What did I do wrong?
I thank those who can help me!
Miriam de Paula (Drika)
PS: excuse errors. I used Google Translator. I do not speak English
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘WordPress doesn't recognize my custom taxonomy’ is closed to new replies.