Question

I'm working with the new custom post type archives in 3.1 and I noticed that when my post type has 0 posts, the archive for the type results in a 404. Looking at the order of hooks being processed, it's redirecting to the 404 template before even processing my archive-{post_type}.php template and reaching the conditional for available posts.

Reading various articles and questions here had clued me in on flushing the permalink state after creating my types. This shouldn't be an issue, however, as the archive page works if posts for the type exist. I even went as far as setting my has_archive value to the post type slug rather than just true to no avail.

Is there a way to force the archive template to be loaded and not generate a 404 regardless of post count while keeping the query in place?

Was it helpful?

Solution

An FYI for those coming back to this question, this was fixed in 3.2: http://core.trac.wordpress.org/ticket/17316

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top