I registered a custom taxonomy named 'tag', code below:
add_action('init', 'reg_custom_tag');
function reg_custom_tag() {
register_taxonomy('tag', array('my_custom_post_type'), array(
'labels' => array(
'name' => 'Tags',
'singular_name' => 'Tag',
'search_items' => 'Search Tags',
'all_items' => 'All Tags',
'parent_item' => 'Parent Tag',
'parent_item_colon' => 'Parent Tag:',
'edit_item' => 'Edit Tag',
'update_item' => 'Update Tag',
'add_new_item' => 'Add New Tag',
'new_item_name' => 'New Tag Name',
'menu_name' => 'Tags'
),
'hierarchical' => false,
'show_ui' => true,
'show_admin_column' => false,
'update_count_callback' => '_update_post_term_count',
'public' => true,
'rewrite' => false
));
}
I then created a few tags, for example: apple, banana, and orange. By default, the url for this taxonomy would be:
/?tag=apple
The above will give me a 404.
I have tried other options:
- Creating archive.php, taxonomy.php, taxonomy-tag.php, failed.
- Set rewrite to "true", which should activate
, also failed.
The only thing I cannot explain is that, I have another custom taxonomy with the exact same settings. The only difference is the name, which is "location".
And magically, depending on the settings, both /?location=north
and work flawlessly.
Can someone please advise? Thanks in advance.