Pre_get_posts Gives 404 on Custom Post Type
Changing a query for the page post type via pre_get_posts is a bit tricky, and maybe not worth the potential issues involved. If you inspect the generated SQL, it’s looking for your requested pagename in the question post type, which is why you get the 404. The solution is to delete the page, so WordPress … Read more