WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 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.

Change History (7)

comment:1 greenshady5 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Looks like this was fixed in revision #11389 somehow.

comment:2 ryan5 years ago

There have been some fixes in this area. Thanks for the confirmation.

comment:3 greenshady5 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

This issue has returned, exactly as described above, since updating to revision #11423.

comment:5 ryan5 years ago

Is this a regression since 2.7.1, or is it broken there too?

comment:6 greenshady5 years ago

It's working great for me in 2.7.1.

comment:7 ryan5 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [11452]) Restore LEFT JOIN for post_status_join. fixes #9851 see #9720

Note: See TracTickets for help on using tickets.