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:
- Limiting Amount of Posts in a Custom Post Type again
- Limit Amount of Pages users can create in Custom Post Types
- Is there a (preferable built-in) way to check what custom queries are used in a theme?
- restricting custom rewrite to just one custom post type
- Mandatory field in Custom post
- Custom post type page with parameter
- Not Able to Add New Class To CPT Attachment Image
- Wp Meta Query does not work while simple Query Works
- Change Text in Admin Panel
- Custom post type category link redirecting to 404 page
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- How to use pre_get_posts on archive page custom post type
- Translate website without duplicate custom post
- Custom post category name showing empty
- How to store the third party script with HTML code in the wordpress custom input field?
- allowing custom user role to access custom post type in wordpress admin
- How to show the post which checkbox is not selected
- Is it possible to get the specific content on the search page?
- Order posts by taxonomy terms
- Get next and prev item from custom WP_Query and Custom Post Type
- 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
- Replace Content of Sidebar on Custom Post Type
- How to show Custom Post Types under Taxonomy in a new WordPress page template?
- How add Filter by Tags and by categories to custom post type in Gutenberg block
- Custom Endpoint For Specific Custom Post Type
- How to upload an image to a custom post type
- 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?
- Error 404 change permalink term custom term taxonomy
- How to add a default predefined thumbnail when creating a brand new post?
- Query to Exclude Child Pages from Custom Post Type Archive
- How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it
- Plugin Development using classes – Public & Private Callbacks
- URL issue retrieving Custom Post Types using Backbone JS API
- Show a custom post title in another custom post type in Meta box
- WordPress Custom Post Loop
- Create a post automatically if search result has zero results
- Register custom_post_type from static function
- Unable to gather Image URL from Custom Post Type’s; Custom Meta Field
- custom post type and user post count shortcode
- How do I troubleshoot pre_get_posts with Debug Bar?
- How to display the post using a shortcode in WordPress?
- Custom post type specific item design
- Changing CPT permalink
- Correct way adding External classes to Custom Post type and output their methods to template
- I have a random letter appearing before my content. Where to start looking for the cause?
- Get all posts by many custom post types
- How to select meta key in custom database query
- ‘Simple’ Reservation System
- Issue removing columns from admin table
- Apply a custom Template to a Custom Post Type from within a plugin
- How to hide private posts even if user is admin
- WP_List_Table Inside Metabox Not Working on Clicking Search Button
- Warning , Use of undefined constant PLUGIN_PATH?
- Shortcode and get_template_part
- dynamic vue widget inside custom post
- Display Specific Posts at Start of Loop
- Restrict Custom Post Type to One Item
- Custom Post Type Front Page Gives 404
- Getting data from dynamically allocated metaboxes within a custom post
- Show Post columns to specific users on condition
- Permalinks: custom post type -> custom taxonomy -> custom sub taxonomy -> post
- WP REST API Custom endpoint don’t work in my plugin
- How to create an upload page (front side)
- WordPress Roles
- Need some hints for my own WP theme development
- How to dynamically register custom post type
- Create settings page to enable or disable CPT
- Menu Structure and URL structure, with Pages and Post-Type-Posts
- How to change post cpt with submit button?
- How to separate posts by categories?
- Custom Post Type featured option
- Custom Post Type urls not working
- How to filter custom post data with AJAX?
- pre_get_posts causes Custom Posts appear under ‘Pages’ menu
- get_post_types() is returning null
- I want to show a list of posts under specified categories
- I want to show a list of post with title that have link goes to that post and icon under the specific category to which it belongs
- Make term slugs of custom taxonomy available in WP REST API for custom post type?
- Sorting by Title for Post Archive Categories for Custom Post Type
- How can I incldue a “private” post type in a loop for public users?
- How to consume external API from WordPress post editor and display the response data in the custom field?
- Custom post type template not loading from plugin
- Redirect to All Custom post types
- I am having a problem with fetching product data in the Gutenberg block editor
- How can I allow plugin users to define layouts for a custom post type
- Post URL redirecting to homepage
- Add block templates (html) via plugin for custom post type
- how can i call archive-{post type}.php template from my custom plugins to my theams?
- get_posts() return NULL using a custom plugin and add_submenu_page() with Post Type
- REST API callback function is not called
- Query custom fields with three dates – start and end does not work
- Search for portfolio tags & mixing portfoliotags and post tags
- Display box in sidebar of custom post type
- How to set up a private custom post type that is accessible in the administrative dashboard?
- Remove `View post` Text
- Add taxonomy or category slug to custom post types URL
- How to Insert Elementor Elements with CSS and JS into a Custom Post Type Using wp_insert_post()? [closed]
- Redirection after saving a post