I find myself in the unenviable position of trying to debug a copy of someone else’s pretty complicated WordPress site and have run into a bizarre problem. Every url on the site (including the admin login) is being sent to the 404 template by *wp-includes/template-loader.php*.
Examining the *$wp_query* object for the page query I’ve found that the page content is present in *$wp_query->queried_object*, but *$wp_query->is_404* is consistently set to true.
This appears to be because of *$wp_query->request* which is set to
*SELECT wp_posts.ID FROM wp_posts WHERE 1=1 AND (wp_posts.ID = ‘[POST-ID]’) AND wp_posts.post_type = ‘post’ AND (wp_posts.post_status = ‘publish’ OR wp_posts.post_status = ‘acf-disabled’) ORDER BY wp_posts.post_date DESC LIMIT 0, 4*
The [POST-ID] value is correct for the requested page, but the query is returning nothing because of *wp_posts.post_type = ‘post’* – all the pages have their post_type set to ‘page’ rather that post.
Can anyone offer any guidance on resolving this?
[ad_2]
Has the theme been custom coded?
Have you tried disabling all the plugins testing?