Custom Post Type Works but Still Shows “Page Not Found”

Hopefully this will provide some answers to anyone who runs into a similar problem.

I had copied/created a (poor) function in my functions.php file that was looking for specific templates and if they were not found it would set $wp_query->is_404 = TRUE and that was the cause of the problem.

Of course, the higher-level answer is let WordPress work for you. If you structure your template files correctly, you don’t need to look for them yourself.

Leave a Comment