Opened 15 years ago
Closed 15 years ago
#9851 closed defect (bug) (fixed)
Custom taxonomy returns 404
Reported by: | greenshady | Owned by: | filosofo |
---|---|---|---|
Milestone: | 2.8 | Priority: | normal |
Severity: | normal | Version: | 2.8 |
Component: | Taxonomy | Keywords: | |
Focuses: | Cc: |
Description
When creating a custom taxonomy, everything works great with the auto-handling of everything. This issue occurs when a taxonomy archive is being viewed.
add_action( 'init', 'create_my_taxonomies', 1 ); function create_my_taxonomies() { register_taxonomy( 'animals', 'post', array( 'hierarchical' => false, 'label' => 'Animals', 'query_var' => 'animals', 'rewrite' => true ) ); register_taxonomy( 'places', 'post', array( 'hierarchical' => false, 'label' => 'Places', 'query_var' => 'places', 'rewrite' => array( 'slug' => 'places' ) ) ); register_taxonomy( 'people', 'post', array( 'hierarchical' => false, 'label' => 'People', 'query_var' => true, 'rewrite' => false ) ); }
I set up three taxonomies here. If setting rewrite
to true
or to a specific slug, a 404 is returned when visiting the taxonomy archive (first two taxonomies).
Example URL: http://localhost/places/andromeda
(404)
If setting rewrite
to false
, no posts are returned when visiting the taxonomy archives (last taxonomy).
Example URL: http://localhost/?people=angel
(no posts)
This is huge considering that the new "auto-taxonomy" stuff has been added in this version.
This was working great at an earlier revision, but I can't be sure which one. The taxonomy archive would list posts just like the tag archives would but doesn't now.
Looks like this was fixed in revision #11389 somehow.