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 to put my code: plugin or functions.php?
- Should I use custom post types or a custom database tables for plugin development?
- Best way to flush_rewrite_rules for custom post type, in a mu-plugins plugin?
- How to completely disable a taxonomy archive on the frontend?
- How to put custom post types on front page
- How to set a fall back template for a custom post type in a plugin?
- How to add multiple images to custom post type?
- Redirect after deleting post and keep track of pagination
- get_edit_post_link() not working as expected when passed id in plugin
- How do I Make a custom post type get a custom post template in a plugin
- WordPress metabox file upload in custom post [duplicate]
- working Custom Post Type and Widget code no longer works when moved from functions.php to plugin
- WordPress custom post action hook
- Uploaded image not appearing in custom post type
- Row actions not showing? Why?
- How do I add a custom button to my “edit” list? ( edit.php?post_type= ) beside “Add New”
- How to add notification in the sidebar of the administration panel when a Custom post type is created? [duplicate]
- how to set default value for checkbox in wordpress
- Using pre_get_posts to Filter Posts
- Custom Post Type get_post_type_archive_link( $post_type ) returns false
- How to have the right design for a custom post type without accessing themes
- Dynamic Custom Post Type Plugin
- need advice on how to do a lists using custom post types – taxonomy vs postmeta
- Get all of user’s custom post types in WP Admin for plugin
- Plugin translation not working apart from name and description
- WordPress theme custom capabilities not works
- Custom posts don’t work
- How to customize a permalink (URL) structure?
- Orderby CPT custom fields not working
- How to sort custom columns for custom post type without meta query and pre_get_posts?
- Update post meta not working in transition_post_status
- Use custom metabox to update automatically a post after a given date
- Custom post type archive page blank
- Custom post listing page layout of custom post type
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- Plugin fatal error
- Suggestion on custom post type/ taxonomy relationship
- WordPress custom post type capabilities issue
- HowTo: Custom Post Type (Meta) to Custom Table
- Custom Empty Results page for my Custom Post Type
- How to group navigation items in the admin panel
- How to access the thank you page from the single post?
- How do you make a list and list item relation if custom post types?
- Add form after woocommerce admin order edit
- How to Use Custom Meta Field Instead of CPT Title in Post URL
- How to query for posts (hierarchical custom post type) that have children but are NOT top level?
- CPT Archive pre_get_posts not working?
- Validate Custom Post Type fields
- Is it possible to sort metabox teaxtarea values?
- shopping cart plugin development
- Modify a plugin function output from another plugin
- Custom rewrite rules for /pastissues/%category%-%postname%.html
- Content in WP Editor displayed below CPT shortcode [duplicate]
- How add column from new table in Custom Post Listing (admin)
- Writing a custom Glossary plugin
- restricting custom rewrite to just one custom post type
- Change Text in Admin Panel
- How to use pre_get_posts on archive page custom post type
- How to show Custom Post Types under Taxonomy in a new WordPress page template?
- Custom Endpoint For Specific Custom Post Type
- Unable to gather Image URL from Custom Post Type’s; Custom Meta Field
- How to display the post using a shortcode in WordPress?
- Custom post type specific item design
- Issue removing columns from admin table
- Shortcode and get_template_part
- dynamic vue widget inside custom post
- Getting data from dynamically allocated metaboxes within a custom post
- WP REST API Custom endpoint don’t work in my plugin
- how to allow subscriber to add/edit/delete custom post type
- Set different posts_per_page for custom post type/taxonomy
- Meta query broken since 4.7.4 Update
- Facing some Issues on Two Parts Custom Post Type Taxonomy Names
- Custom meta box in editor of custom post type not working
- Remove Custom Capability
- Can I override the permalink/slug on creation
- Pre_get_posts comparison with custom field doesn’t work
- Custom Post Type shows pagination (w/404) or posts_per_page query, but not both
- call_user_func_array() error after moving to another server
- Displaying multiple custom post types in single post type at admin section
- Custom Post Type Audio Content
- Organizing The Custom Post Type with Taxonomies / Parent Posts
- Items By Group added to custom post type
- Setting a custom $query->query_vars[‘meta_key’] breaks the WordPress menu
- Custom Taxonomy Showing in WP Menu
- pre_get_posts action doesn’t work
- Issue on Adding Taxonomy to Custom Post Type Using Function
- Custom Post Types in plugins?
- Multiple Block Quotes without using HTML
- How to apply order on custom taxonomy and custom meta key on custom post type
- Hide custom post type and use its slug in new plugin menu
- Don’t display post if post has empty body
- Set a Custom Post Type as a Homepage
- Menu Structure and URL structure, with Pages and Post-Type-Posts
- Custom Post Type urls not working
- 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
- 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?