If we look in source, we’ll see under what conditions is_archive is true:
if ( $this->is_post_type_archive
|| $this->is_date
|| $this->is_author
|| $this->is_category
|| $this->is_tag
|| $this->is_tax )
$this->is_archive = true;
The issue is that is_archive is triggering your filter on your post type archive. If you want to exclude those, either make sure it’s not is_post_type_archive, or target the other archives by checking if it’s an author or date archive as well as tag and category and remove the check for is_archive.
Related Posts:
- Where, When, & How to Properly Flush Rewrite Rules Within the Scope of a Plugin?
- Custom Post Type Plugin: Where Do I Put The Template?
- How to Add Custom Taxonomy To Woocommerce Plugin
- Creating a Custom Post Type as a Plugin? Why?
- Quick edit screen customization
- Mini-Site Strategy
- $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?
- Include post id[s] into WP_Query()
- Pre get posts for single post
- Render a different post/template from within the template_include action?
- Pre_get_posts Gives 404 on Custom Post Type
- filter search result with custom post type meta key
- Order posts by (hierarchical custom) taxonomy terms and term children
- Can’t sort order of wp_query with 2 meta keys
- Custom Taxonomy and tax_query Issue?
- How to register custom post types in a plugin?
- Actions that Run on Admin Edit Page Load After Posts Are Queried
- Custom role capabilities to administrator not taking effect (no plugin)
- Hierarchical or Non-hierarchical Custom Post Type in Real World Example
- Display all Posts and only certain Custom Post Types with meta fields
- How to append element after thumbnail
- How could I create a ‘private comments’ section on a custom post type?
- How to sort custom post type posts in default order by multiple fields?
- Custom Post Type rewrite
- Admin notice not displaying
- Detect where custom post type is declared
- Insert Multiple Post with Same Publish Button
- get_object_taxonomies() returns empty array for custom post type
- custom post type not showing in menu
- Adding a custom post type taxonomy template in plugin
- Plugin: register custom post types, child ready and performance best practices
- Add custom ID to CPT posts only create not update
- Add custom post type as submenu [closed]
- Getting meta in editor plugin, and event triggering issue
- Unable to get Custom Plugin Options data
- What is the best practice for displaying my plugin content in themes?
- How to use TinyMCE Editor for one of my custom post meta field?
- Deleting taxonomy terms and relationships on a custom post_type when a user is deleted
- Custom fields for custom post type
- Save Multiple Metabox values
- How to add and clear custom post types and taxonomies in a plugin? Considerations for existing data
- post_parent in custom post type
- What’s an efficient way to change the post status of many posts at once?
- Dynamically insert code to custom post type loop
- How exclude or skip post type with get_next_post_link
- Prevent A Specific Custom Post Type Showing In WP Search Results Page
- How to add and display custom content that is not a post
- Problem with adding custom post type meta to header by plugin
- Creating alternate meta box context locations
- Types plugin custom post add_action hooks
- pre_get_posts works in post type archive but not in single post
- Limiting Amount of Posts in a Custom Post Type again
- Not Able to Add New Class To CPT Attachment Image
- Order posts by taxonomy terms
- Auto update publish date of CPT Post if default post custom field value match to cpt post CF Value
- Orderby custom fields is not working
- Why are custom taxonomies only appearing on the edit page of one of these types, but not the other?
- How to stop the custom post type URL from the google search?
- How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it
- URL issue retrieving Custom Post Types using Backbone JS API
- WordPress Custom Post Loop
- Changing CPT permalink
- Get all posts by many custom post types
- ‘Simple’ Reservation System
- How to hide private posts even if user is admin
- Warning , Use of undefined constant PLUGIN_PATH?
- Show Post columns to specific users on condition
- Error when moving custom post type to bin
- List all posts associated under custom taxonomy
- Admin metabox with custom post type dropdown option not update choosed input after saving
- Having issue on Loading Meta Data From CSV to CPT
- custom data model – link and populate from admin backend
- Custom Post type plugin is using theme single.php and style.css
- CPT year wise archive based on custom date Field
- php output of generated custom metabox
- call a function when insert and update a custom post type
- What’s the most efficient way to get two queries based on an if statement?
- Can’t save custom post type fields
- Registering an optional custom post type from a plugin
- Shortcode error
- pre_get_posts with multiple post types AND a meta_key
- Generate custom RSS from a plugin
- Fetch post meta in the same query as the main loop
- Problem to show custom post type in archive page category wise
- Adding custom post types to the default loop, yet only posts that has terms from the core taxonomies
- Get term_id for each instance of custom taxonomy
- How to internationalize the sub menu name “categories” in Custom post type?
- Creating a Custom Post Type as a Plugin? Why?
- WordPress Roles
- How to change post cpt with submit button?
- How to separate posts by categories?
- Custom Post Type featured option
- Make term slugs of custom taxonomy available in WP REST API for custom post type?
- How can I allow plugin users to define layouts for a custom post type
- Post URL redirecting to homepage
- Query custom fields with three dates – start and end does not work
- How to set up a private custom post type that is accessible in the administrative dashboard?
- Remove `View post` Text