url rewriting - Custom taxonomy named 'tag' return 404 page

I registered a custom taxonomy named 'tag', code below:add_action('init', 'reg_custom_tag'

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:

  1. Creating archive.php, taxonomy.php, taxonomy-tag.php, failed.
  2. 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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745162289a4614442.html

相关推荐

  • url rewriting - Custom taxonomy named 'tag' return 404 page

    I registered a custom taxonomy named 'tag', code below:add_action('init', 'reg_custom_tag'

    3小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信