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
- Remove date rewrite rule for custom post type archive page
- Custom Taxonomy URL are redirecting to page with the same name
- Custom Post Type Archive Page Filtering
- Root slug of taxonomy returning 404
- How to have custom post type /example/ and then posts /example/posts.html
- Remove url rewrites for registered taxonomies
- Add archive slug to default post post type
- Custom Post type and permalink settings
- How to modify archive query with pre_get_posts to append CPTs?
- What template files do I need to customise custom-category-term-links rather than fall back on archive.php?
- get the custom post type title/name
- Get archive post type name
- Tag Archive for Custom-Post-Type Posts yielding 404 when permalinks set to postname
- Rewrite slug of custom post type to include post-id
- Change custom post type slug from plugin options
- Default sort on admin columns with meta date hides draft posts with empty date value
- URL of a custom post type’s post format archive?
- Filtering WP_Query
- Get term name and term parent into custom post type permalink
- WP_Query most viewed posts, in multiple Post Types, last 30 days, excluding a specific taxonomy term
- Rewrite rules for custom posts types
- Custom Post Type with archive page but no detail page
- Rewrite post type slug only for child theme
- Create template for taxonomy results limited by Custom Post Type
- wp_list_categories() – current-cat class also inside posts?
- Custom Post Types, URL rewrite on multiple CPTs
- Allow non-logged in users to see a future post after clicking on a list of future posts
- How can we take into account post types when constructing permalinks?
- Help need making decision. Ads rotating site on wordpress
- Query & Order posts by custom fields
- 404 Issue w/ Custom Post Type – using Meta for Permalink rewrite
- Custom post type – get_day_link()
- Get Taxonomy Term Title by it’s URL
- custom taxonamy and post type
- What is the recommended / best way to do this: Event calendar post/type in a block-based theme?
- Taxonomy custom post type URL
- How to change custom post type permalink structure
- Change CPT archive title
- Front custom edit post page for each post
- Adding custom post category slug in permalink causes 404 error for pages and posts
- Categories of Custom Post throws gives 404
- How can I use get_post_meta with add_rewrite_rule to build custom permalinks?
- How to build custom route by adding taxonomies to URL ? ex: www.demo.com/communities/palo-alto/
- Return the latest post from a custom Taxonomy and Post Type
- Can’t get custom rewrite tag, query var, permastruct (permalink structure), and rewrite rule to work properly together
- Don’t know how to show custom taxonomies from a custom post_type
- How Can I Change the Custom Post Type Slug to the Taxonomy Slug in the URL?
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?
- Custom rewrite url category
- Rewrite Question Mark in Post Template to Make it Pretty URL
- How can achieve this permalink perfectly? domain.com/%category%/%post-name%
- How to get post type and month/year before while loop for date.php file
- Not Able to Get Custom Post Type Gallery Images URL
- Index page with the same id as the slug
- Post count by month of taxonmy term
- JS innerhtml changing style when using AJAX
- How can I make the slug of the taxonomy also the slug of the custom post
- WordPress custom post type permalink rewrite shows page not found
- Why is my site using index.php instead of archive?
- Using taxonomy term in CPT permalink – Pages 404’s
- Display a grid of taxonomy terms at root taxonomy page
- How to add rewrite rule to custom post type with parent in url with cpt ui?
- Custom post type as home page with custom url
- WordPress showing archive.php instead page
- Customize Custom Post Type URL
- How to rewrite url for any specific taxonomy?
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- Custom post URL 404 error
- Programmatically rewriting slug through functions.php but returns 404
- How to change the post type a theme shows by default?
- Get unique superset of taxonomy terms from a list of custom posts in another hierarchical taxonomy
- How do I change the custom taxonomy slug to be the same as the custom post type slug?
- URL rewrite add author as base
- Custom Permalink to remove category word , keeping posts permalink with date?
- Custom post type archive page blank
- Set a CPT slug as a base name for all the taxonomies