Here is the solution of my problem, thanks to @Milo:
function wpa_date_archive_post_types( $query ){
if( $query->is_main_query() && $query->is_date() ):
$query->set( 'post_type' , array( 'movie' ) );
$query->set( 'year' , 0 );
$query->set( 'tag' , '1994' );
$query->set( 'post_status' , array( 'publish' ) );
endif;
}
add_action( 'pre_get_posts', 'wpa_date_archive_post_types' );
Related Posts:
- Generate daily archive whenever any post type is added
- Custom Post Type Archives by Year & Month?
- Custom post types – Use post_id in permalink structure when using has_archive => true
- Meta_Query as a way how to setup CPT permalinks – is it a good thing?
- Archive page with multiple taxonomies rewrite
- Create permalink structure for one taxonomy archive per custom post type
- Custom Post Type Archive URL takes over page URL
- Removing CPT slug from URL results in 404 error for archive page
- Regex problem in an add_rewrite_rule
- Custom post type archive sorted and grouped by date in post meta field
- custom taxonomy archive by year
- CPT Archive with core Category
- Archieve.php not loading for custom post type
- Archive links for custom post types
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- How to constrain the results to a specific post_type on tag archive page?
- Archive page for custom post type and custom taxonomy
- Custom Post Type Date Based Archive URL rewrite [duplicate]
- How can I tell if I’m on a custom post type archive page?
- Custom Post Type archive page listing a 404 or single post
- Want to display my custom date archive to date.php but dont know how
- date archive future posts
- Custom post type and custom taxonomy archive inaccessible
- Mixing custom post type and taxonomy rewrite structures?
- How to rewrite URI of custom post type?
- Filtering a custom post type by custom taxonomy in archive template
- get term archive url / link
- How to get the custom post type from an archive page?
- Custom post types – Use post_id in permalink structure
- Assign single template to multiple custom post types?
- Rewrite custom post type rss feed links
- Archive page…limiting posts per page
- WP 3.1 – archive pages for custom content types possible now without a plugin?
- How can I fix those issues generated by the Themecheck plugin
- Why is get_post_format() for “Standard” returns empty
- Taxonomy page returns 404 page not found
- Password-protect a custom rss feed
- Remove unwanted part of permalink custom structure from CPT url?
- How to have a custom URL structure for a custom post type?
- Changing a custom post type “has_archive” after registered
- Call different archive page based on post type
- Custom Post Types – How to include custom fields
- Custom Post Type slug same as page name causing a conflict
- Adding paged query to custom URL rewrite
- Customising rewrite rules for CPT single post URL to work as paged URL
- Custom WP TItle from custom template with dynamic URL structure
- Page as a child of a Custom Post Type
- Change URL of posts and also Custom Post Type
- Custom Post Type rewrite
- Remove url rewrites for registered taxonomies
- How to modify archive query with pre_get_posts to append CPTs?
- Get Taxonomy Term Title by it’s URL
- What is the recommended / best way to do this: Event calendar post/type in a block-based theme?
- Change CPT archive title
- Using taxonomy term in CPT permalink – Pages 404’s
- Display a grid of taxonomy terms at root taxonomy page
- Custom Permalinks with CPT and Hierarchical Taxonomies
- Why isn’t my custom post type archive URL translating?
- Post Type rewrite rule to point to custom Page/template
- Custom Permalink Structure for Custom Post Type, Custom Taxonomy, Under a page
- The loop seems stuck to a single (now deleted) post
- Use “archive” as slug for custom post type
- Ignoring slug capitalization on rewrite rule for custom post type archive page
- Taxonomy in URL
- Warning: Invalid argument supplied for foreach() [closed]
- Custom post type isn’t working
- Getting Un Wanted Gallery Shortcode In The Page on Loop
- Taxonomy archive 404ing (not term archive)
- Show Taxonomies with admin area for custom post type?
- Pagination doesnt work in custom post type
- How do I know if a rewritten rule was applied?
- How Can I Remove Custom Post Type Slug From URL
- Custom Post Types and Removing Slugs – should we do it?
- Need to have an archive widget which organizes and displays a custom post type using a custom date field
- Taxonomy rewrite pagination 404
- How to sort WP_Query by a custom text field (written as a date dd/mm/yyyy)
- How to display posts from a certain category in a bootstrap 5 carousel loop with multiple items?
- Loop all post on single.php
- Define multiple prefixes for custom post type
- programmatically generated custom post type is created more than once
- get_queried_object not work in taxonomy page
- Custom WordPress theme not displaying posts from category
- Custom Post Type parent/child relationship rewrite rules for permalinks
- Order archive custom posts by taxonomy term [duplicate]
- call a function when insert and update a custom post type
- Force WordPress to only match URL in category
- Custom post type with parent page? Possible?
- Search form to find custom meta box generated data
- Custom Post type archives / categories give 404
- Why won’t this rewrite rule work?
- Archive.php is not displaying tags
- Change custom post status to draft before today
- paging is not working properly on news archives page [duplicate]
- How to save an integer as taxonomy term?
- is_singular won’t call my functions?
- How to turn custom-post archive into an overview page, listing the metadata of the posts?
- Custom post type permalink structure
- How to create custom page templates with default page layout framework?
- Menu Structure and URL structure, with Pages and Post-Type-Posts
- Show custom category archive as front page and remove taxonomy slug from urls