Hi all,
I have a page which pulls posts from an RSS feed that come late at night. Instead of those posts appearing for that day, I would like them to appear on the subsequent day's archive page. Changing the queries on the archive.php file was easy enough, but as there are only new posts Monday-Friday, any Friday archive page will redirect to the 404 page as there are no posts on that particular day.
So my question is: What do I have to do to NOT redirect to the 404 page for an archive day with no posts? I feel like I need to add an action either before or after parse_request, but I have not had any success by setting the "is_404" variable or the "error" field in query_vars. I do not want to change any of the post's metadata as that information is used elsewhere on my page.
Anyone have any ideas?
Here's my add_action:
add_action('parse_request', 'fix_missing', 0);
and here's my function:
function fix_missing() {
global $wp_query;
$wp_query->query_vars['error'] = '';
$wp_query->is_404 = false;
}