[wp-trac] [WordPress Trac] #9851: Custom taxonomy returns 404
WordPress Trac
wp-trac at lists.automattic.com
Sun May 17 17:14:19 GMT 2009
#9851: Custom taxonomy returns 404
--------------------------+-------------------------------------------------
Reporter: greenshady | Owner: filosofo
Type: defect (bug) | Status: new
Priority: normal | Milestone: 2.8
Component: Taxonomy | Version: 2.8
Severity: normal | Keywords:
--------------------------+-------------------------------------------------
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.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/9851>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list