The problem is with the rewrite rules generated with the post type- they’re a bit greedy and are capturing those requests. WordPress is trying to query for a matching category_type
, which isn’t actually an object type, and in the absence of any other valid query argument, it runs the main blog query.
You could manually generate the post type rewrite rules in a way that is less greedy, or you can add a rule that just overrides them in the case where ARTICLE_NAME
isn’t present:
add_rewrite_rule(
'^community/articles/([^/]*)?/?$',
'index.php?pagename=community/articles/$matches[1]',
'top'
);
When dealing with rewrites, I recommend the Monkeyman Rewrite Analyzer plugin, which will give you a new menu item in admin under Tools where you can plug in URLs and see how they are matching to rewrite rules and parsing to query vars.
Related Posts:
- Custom permalink rewrite rules – how do I fix this?
- Redeclare/Change Slug of a Plugin’s Custom Post Type
- Custom Post type & Taxonomy URL structure
- Slug Formatting : Acceptable Characters?
- Disable permalink on custom post type
- Combining Multiple Taxonomies in one URL
- Change slug of registered custom post type in child theme
- Dynamic taxonomy in permalink made all other posts NOT FOUND?
- How to achieve this permalink -> category-name/custom-post-type-name/post-name
- Make permalinks based on an ACF-field
- ACF Relationships in Custom Post Type Permalink
- Prepend meta_value to permalink of post
- Remove Slug from Custom Post Type results in 404
- Remove taxonomy slug when not assigning taxonomy with custom post types
- Can’t edit Custom Post Type slug/permalink
- Remove Taxonomy Slug when No Taxonomy is Assigned to Custom Post Type?
- Custom Permalink with Dynamic Taxonomy for Custom Post Type – Works, but breaks other permalinks
- Custom Taxonomy breaking pages permalinks
- How to Display ACF Relationship Custom Field as Link to Specific Custom Post?
- Custom Post Type with two hierarchical Custom Taxonomies: strategy to generate best permalink structure
- Automaticly add slug to posts
- How do I fix permalinks for custom post types that has the same slug as a page?
- How to retrieve category NAME instead of ID in a function with a taxonomy custom field?
- Why does wordpress keep adding postname to my CPT’s permalink in the end?
- Wrong generated page_name/slug on first publish of custom post type
- Remove post type slug of all post types from permalinks
- Stop / prevent WordPress from updating permalinks of custom post type
- Change custom post type slug from plugin options
- Child post with numeric only slug keeps redirecting to parent
- How to add a post slug to a url?
- Permalink for a custom post type isn’t working and I don’t know why
- How to target a specific custom post type post and its all children and grandchildren?
- Assign same parrent Page to pages AND custom post types
- Create a custom php page and load it at a specific slug
- CPT archive admin menu label
- Rewrite Rule for showing Parent/Child Relationship between Two Hierarchical Custom Post Types
- How to change permalink to include custom post type
- Custom Post Type – Duplicate Page Slugs
- Redirect to another page using contact form 7? [closed]
- Remove permalink for custom post type
- How do you create %post_type%/%postname%/ permalink structure?
- Change Slug of a Custom Post Type
- How to inherit field value from parent post into in child / sub post
- Create short URL with auto 301 redirect
- Custom Post Type Advanced Slug
- Rewrite permalink for multiple post types (CPT) with taxonomy term
- Custom Post Type to replace Woocommerce products – page not found error
- Custom Post Type with Configurable Sidebar via ACF
- Need to return a string as permalink insted of str_replace
- Under What Conditions Can I name my CPT the same as my CPT Page?
- Excerpt length: get first paragraph
- Custom post ID & display information related to this ID
- Is there a way to use ‘publicly_queryable’ => false only on specific taxonomy term?
- WordPress URL rewrites using Advanced Custom Field
- Change permalink incrementor into pseudo-subdirectory
- Some permalinks on Apache/localhost development setup return 404’s when set to anything other than plain permalinks
- Custom post type URL structure with site.com/custom_taxonomy_slug/post_name
- Two CPT: one is using part of the custom rewrite slug from the other
- Post Custom & Taxonomy 404 error
- Getting a 404 on single custom post type page when using rewrite on a custom taxonomy
- Can I override the permalink/slug on creation
- Get full control over custom post type url
- Add category slug as class attribute in a link array
- Remove Custom Taxonomy Slug only without removing Custom post type slug in permalinks
- Get post id of permalink for a specific custom post type?
- Can’t make permalink of CPT work
- How to make nested custom post type slugs work
- Can’t preview custom post – Redirected to home page
- How to I add count of custom posts listed in a post as a prefix to its title
- Hide custom post type slug url from search engine [closed]
- Custom post type Premalinks main page and details page
- Is it possible to use a post name in a custom post slug?
- How to change permalink structure off default posts and also CPT’s posts
- How come Featured Image isn’t showing up in my Custom Post Type?
- Mixing custom post type and taxonomy rewrite structures?
- Resolve a custom post type name vs. page permalink conflict (same slug)
- How can I add dropdown widget/box to admin post page?
- Custom permalinks – post type – hierarchical taxonomy’s
- Meta Query “IN” doesn’t work with ACF checkbox filter
- Rewrite CPT slug with two taxonomy slug instead of one
- Custom post types and permalinks
- Display multiple custom post types and sort them chronological by one of their fields
- post_type_link not working in gutenberg
- Change CPT archive title
- The loop seems stuck to a single (now deleted) post
- Add a permalink variable onto custom post type URL after post name slug
- Custom Post Type permalink without /%day%/ and/or /%postname%/
- new post-type how do i retain the plugins on my sidebar?
- Custom Post Type Dashboard Tab not displaying any posts
- Filter result of Custom Post Type using meta_query with ACF
- Assigning categories to custom post types via a front-end form; only works for native post type
- Custom sorting in post columns by ACF Pro Select Field
- How to make a custom search template for custom taxonomy?
- How to retrieve custom post type permalink in another cpt?
- Custom Post Type and Taxonomy pagination permalink
- Custom post type permalink structure
- How do I use CPT and permalinks with a mobile theme?
- WooCommerce – Complete Order when an action occurs
- Custom taxonomy meta fields
- Modify permalink of CPT archive to support two taxonomies