jjgrainger / wp-custom-post-type-class

A PHP Class for creating Wordpress Custom Post Types easily
MIT License
416 stars 114 forks source link

Register taxonomies first? #28

Closed FriendlyWP closed 9 years ago

FriendlyWP commented 9 years ago

Thanks for this class, very useful!

One note, in order to ensure taxonomy permalinks always work, it's useful to switch lines 168 and 171, so that the taxonomies are registered first. Bizarre but true, see this post: http://clarknikdelpowell.com/blog/the-right-way-to-do-wordpress-custom-taxonomy-rewrites/

In the current configuration, taxonomy slugs that include a path ("books/genre") instead of just a simple slug ("genre") get created correctly, but result in 404's when you surf to them. Swap so taxonomies are registered first, and they work.

jjgrainger commented 9 years ago

Interesting! I'll get to this today/tomorrow when I get 5mins.

Thanks :)