You can move the code from OP’s answer into a 404 template filter and force WP to load the date.php
file instead of 404.php
. It’ll still send the 404 header, but render the page with a different template.
function wpd_date_404_template( $template="" ){
global $wp_query;
if( isset($wp_query->query['year'])
|| isset($wp_query->query['monthnum'])
|| isset($wp_query->query['day']) ){
$template = locate_template( 'date.php', false );
}
return $template;
}
add_filter( '404_template', 'wpd_date_404_template' );
Related Posts:
- WordPress Posts By Date/Day?
- Archive filtering posts by year and month
- How to get the date dynamically from archive.php to date.php?
- Making next_posts_link(); return posts by month
- How can I change the way dates shown in the archive widget?
- how do I get the date in a date archive page
- What’s wrong with my date_query?
- Displaying Archives List
- Some archive by year page return 404
- How to filter by date & a specific custom post type post-WP 4.4?
- Date Archive pages 404 error
- Show all 12 months regardless they have posts
- How to disable date archives?
- date.php shows only three posts’ title. how to fix it?
- How to hide the year in archive link
- Is each issue of a magazine site a static page
- Get list of years when posts have been published
- How can I lock down an old wordpress install I don’t intend to update?
- 404 Error On Category and Tags Pages
- Pagination throws 404 error on custom taxonomy archive pages
- How can I get the Month Name from Archive?
- Including post_type = ‘wiki’ in author archives
- Count posts for each year
- Archive in sidebar with dropdown list of Year – Month – Day
- How can I organize/create an archive listing by Year and month
- Change behavior depending on content length
- How to edit archive page’s content inside wordpress dashboard?
- Archive pages for posts based on their taxonomy?
- How can I get archives for specific category without category_base in the url?
- Remove author archive
- Preview Post/Custom Post types in Archive
- Displaying year, month and day archives differently
- When i try to open archive pages i get a 404 error
- WordPress subcategories return 404 in custom template
- How to show year/month archive including months with no posts
- Archive links don’t work when clicked
- wp_get_archives() display months even if there is no posts
- how do I encode links to specific archive searches?
- Group Posts by Category in Monthly Archive
- Loop through years and months in WordPress archives
- Dropdown to select posts by month and then displaying those posts in the archive page
- Having a problem with Next and Previous Links
- Custom post type archive page thinks I’m not logged in
- ‘Archive’ folder for posts and pages
- Post preview gives 404 when permalinks are purely date based
- Filter post by clickable year [duplicate]
- Wrap the “show_post_count” between div
- Is a list page usually called an archive page in WordPress?
- Get current title of archive.php
- How to show months in wordpress archive page?
- Problems with 404, .htaccess, permalinks and WordPress custom posts locally on Snow Leopard
- I want my yearly archives to show a list of all posts
- How can I modify this to show number of posts-per-month?
- How to count the number of archives there are
- Get archives as array
- Archive page showing wrong month
- Create an archive listing based on meta array
- Can’t Access Sessions or Variables through pages
- How to make an archive page template using WordPress 3
- How to display an archive with multiple authors
- How to Get The Excerpt of the page that displays Blog Posts
- How can I loop only months foreach year?
- Where is the content that is outputted by get_the_archive_description()?
- Create simple columned archive page
- I created a normal page, but the page displays as an archive page
- On my archives page, I can’t see my custom post types catergories
- How to get the Custom Post Type Archive inside a folder
- WordPress archives in header -necessary?
- Blog pages show at most unrecognized by code
- Combining custom taxonomy posts with default posts on one archive page
- Create a custom URL for blog archive
- Any kind of custom post type in the front page and in the archive listing
- Custom archive pages without “the loop”
- How to get type of archive whether it is post or date or category archive?
- How can I create a master archive?
- Over 500.000(!) unwanted archive pages, major duplicate content problem
- Link back to (paged) archive and find the correct page
- How to share the author’s archive?
- How can I show a list of posts using the dynamic selection box?
- My page is shown as archive in my site
- I want to be able to access archives to see how recently a post has been read: How can I do that?
- google index an Post type page I do not want
- All tag/category/custom taxonomy archives 404
- How to remove or hide archive page?
- Hierarchical taxonomies in permalink cause 404 for sub term archive
- How can I modify wp_get_archives() to not use archive.php template?
- Custom Taxonomy Archives Page Errors
- Archives widget doesn’t work?
- Archive – Show Video from First Post
- Missing content on author archive page
- Yearly Archive Page?
- date.php shows all posts. how to fix it?
- Show recent posts in single-post page
- How to edit wordpress post without republishing
- How can i display in themplate file only a few post
- how to hide all posts under one category
- How to remove “Archives” after category name?
- Filter the post listing for a particular category from archive month list
- How to show monthly archive posts?
- Can a scrollable date picker be done in WordPress for archives?