You seems to assume that it would grab archive for first of multiple post types. But why? Order in this case does not indicate any kind of priority.
WP seems to consider that logical as well. If you take a look at get_archive_template()
the individual template will only be considered if there is only one post type in query.
Multiple post types in query will cause archive.php
to load, as you are observing.
If you want to load more specific template, you would need to override that via filters as well, for example with archive_template
one (dynamic one in get_query_template()
).
Related Posts:
- $query->set in pre_get_posts is unintentionally affecting the backend
- Add Custom Post Type to Current Query
- How to show more posts on an archive page?
- Custom post type with tags
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- Custom post type posts don’t show in archive widget
- Query multiple taxonomies with pre get posts
- Custom Post Type setup
- pre_get_posts works in post type archive but not in single post
- Pagination not working with custom loop
- Custom Post Type Archives by Year & Month?
- Get custom post type slug for an archive page
- Prevent pre_get_posts filter on specific post type
- get attachments for all posts of particular post type
- Custom Post Type Archives by Date with Custom Permalink
- Custom Queries: Joining On Meta Values From Two Custom Post Types
- is_singular won’t call my functions?
- Querying Posts by Taxonomy From Alternate Network Site
- Change plugin’s has_archive = true to false?
- show posts only on homepage but using custom post type and taxonomy for query posts via url
- Include different loop templates in search query
- Slug for standard post post_type
- Using pre_get_posts to Filter Posts
- WordPress custom post type archive with description
- CPT: archive-cpt.php VS custom page template
- Get post type from taxonomy or category page
- Category page only displaying the posts from a custom type
- custom taxonomy archive by year
- When ‘is_post_type_archive()’ return true?
- Is it possible to create a shortcode that will query a post based on taxonomies?
- Selecting New & Edit Page for Custom Post Types
- Using pre_get_posts to filter one loop in a multiloop archive
- Change archive page template using pre_get_post
- CPT Archive with core Category
- Custom post type redirected to homepage – how to debug
- get the custom post type title/name
- Get archive post type name
- Filtering WP_Query
- Custom post type – get_day_link()
- Meta query for custom post type ignored in main query
- Querying Two Custom Post Types with OR Not Working
- How do I move/order posts with a tag to the end?
- How to sort custom columns for custom post type without meta query and pre_get_posts?
- Why is my site using index.php instead of archive?
- Custom post type archive page blank
- How do I check if the user is on a taxonomy term parent, child or grandchild page?
- Custom post type / taxonomy rewrite archive page 2 gives 404
- how to remove pages loading with the archive templates
- show all custom posts types in home page
- Make (custom) post type accessible only by custom query
- Archiving custom post content?
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- Custom Query: If One Post Object Field Value Is The Same As Another
- How to query for posts (hierarchical custom post type) that have children but are NOT top level?
- CPT Archive pre_get_posts not working?
- Get the link of the first post of a custom taxonomy in a custom taxonomy list
- How can I relate custom post types?
- Hide text if query has no posts
- How do I get the index for a custom post?
- Create query for both custom post type and category
- Filtering custom posts by custom fields (ACF) [closed]
- Custom taxonomy query showing more than 4 posts
- Display CPT index page as front/home page
- Event Archive by Month
- How to divide Subcategories into pages of parent category wordpress
- Display all Categories except ones with a specific parent
- How to achieve a multi-taxomony layout with posts?
- Archive per year of a custom post getting the wrong post
- WP Query: If field X is empty, show posts based on field Y
- Shortcode with loop stacks output
- Displaying all posts by category and showing content on click
- Custom post type order by post_title
- Tell wordpress to show a single page instead of an archive page
- Custom post type categories giving 404
- How can i remove post type archive URL?
- Custom post type URL structure with site.com/custom_taxonomy_slug/post_name
- Set different posts_per_page for custom post type/taxonomy
- Meta query broken since 4.7.4 Update
- Custom taxonomy archive slug overwrites static page
- Custom Post Type shows pagination (w/404) or posts_per_page query, but not both
- Help ordering custom query by Title, Ascending
- How to add parameters for custom post type
- Rewriting archive page slug to be different than custom post type slug
- Is it possible to add query parameters on the archive page?
- Site loads very slow for archive custom post type page
- Setting a custom $query->query_vars[‘meta_key’] breaks the WordPress menu
- Query Only Show Text on Posts With Certain Taxonomy Tag
- pre_get_posts action doesn’t work
- Query Posts From Multiple Post Types
- Pagination not working with custom loop
- how to limit query_post to first page?
- Pagination not working with custom loop
- Retrieve post data via WPDB class
- Listing custom post type items from a couple of custom taxonomies
- Pagination not working with custom loop
- Generate daily archive whenever any post type is added
- Show custom posts with a specific “custom TAXONOMY slug” on startpage
- Posts 2 Posts: query connected — orderby problem
- Load posts via AJAX without draft status
- WordPress CPT archive page display sticky post first and then display the rest of the posts in same Query