You need to add a custom rewrite rule in functions.php:
function your_cpt_rewrite_rule() {
add_rewrite_rule('(.*?)$', 'index.php?your_cpt=$matches[1]', 'top');
}
add_action('after_theme_setup', 'your_cpt_rewrite_rule');
Related Posts:
- Use template_include with custom post types
- Combining Multiple Taxonomies in one URL
- Get Posts in a Custom Post Type category
- how can I create a calendar for a cpt, using get_calendar or other
- Custom Post Type Archives by Date with Custom Permalink
- Numbering sections and block-level elements in wpautop(); WordPress as CMS for long-form writing;
- Modify custom post type rewrite rules in a separate function
- Custom Queries: Joining On Meta Values From Two Custom Post Types
- ‘No pages found’ in Dashboard after registering custom taxonomy
- Why is wp_is_post_revision always false?
- Change page /2 to /transcript with a Rewrite
- Issue with saving custom post type when editor is removed
- How would I leverage custom Taxonomies in this scenario?
- Using custom post types in submenu + custom title
- Possible to combine two custom post types?
- Dynamic dropdown custom post list based on dropdown selection
- Changing ‘rewrite’ argument after custom post type is registered [duplicate]
- Excluding post type from WordPress link builder
- Multiple Content Block
- Creating a function that receives the taxonomy terms that have been changed in a custom post type
- Thumbnails on next/previous links in custom post type single.php
- Create and edit posts from front end
- 2 different post->IDs for single page load only in Firefox
- How to show custom (checkbox) field value in admin post list?
- Allow Users Access to Custom Post Type Only
- Recommended custom post type structure for TV Schedule site?
- How to filter out post type meta?
- How to replace custom post type slug with an ACF value?
- How to Duplicate (multiple meta box)?
- Custom Post Type: Upload Multiple Images
- display span element if in certain post types
- How to detect filter in URL in Category page?
- How Do You Add a Second “Posts” Menu to Your Dashboard?
- CPT issue: Warning: call_user_func_array() expects parameter 1 to be a valid callback
- How do I correct an incorrect permalink?
- Update permalinks when new category added to custom post type taxonomy
- What’s a better alternative to this code?
- Post form as custom post
- Loop custom taxonomy to get lists of cutom post types?
- Is $object_type truly required with register_taxonomy()?
- Query & Order posts by custom fields
- Show a Category X’s custom post type on Category X archive page?
- output custom post types on front-page.php
- Allow Static Page Load Dynamic Child Pages
- Structure of data : CPT + terms
- Display post content with respect to its title?
- WP_Query orderby and tax_query
- Load Next Posts With AJAX not working with custom post type
- What functions does WordPress use for filtering / sanitizing comments?
- admin-ajax.php GET custom-post titles
- Creating custom post type with custom taxonomy and custom fields programatically
- wysiwyg editor don´t export paragraph
- How to see posts in taxonomy endpoint
- Graphql: Unable to query (where:{author}) for custom post type
- Get taxonomy singular name instead of taxonomy slug inside $taxonomy query
- Auto post creation
- Unable to format dates to put in event calendar
- Dynamic assign a custom template to custom post type posts
- posttype and custom fields on multisite
- Custom fields not showing in custom post type
- Custom Post Type with modified permalink structure results in 404
- Custom Post Type Pretty Structure
- Arduous WordPress Custom Post Type Permalink Path
- Displaying information from custom field on custom post type
- Custom post type archive – error in nav-menu-template.php
- Issue with Custom Post Type Tags
- Order custom posts by taxonomy, then by meta_key
- How to use taxonomy term as permalink folder
- How do you make relational post types in WordPress? [duplicate]
- returning the currect URL for nested posts
- Why is my custom post content only viewable when signed into WordPress?
- Show Post Revisions on front-end
- How to show Custom Post Type – Case Study using Shortcode & ACF
- Custom post type data not displaying If I select the category from the dropdonw
- How to add a default predefined thumbnail when creating a brand new post?
- How to select custom posts thats are tagged with multiple taxonomies using wpdb
- Prev/Next Navigation on Single Post Disappeared for Custom Post Type
- How to use posts as tabs in a custom page?
- How select query is generated in a Custom Post Type?
- Custom post types saved as basic post
- Taxonomy shows up twice on Custom Post Type
- Replace admin edit.php content for CPT
- Adding orderby url parameter to main CPT admin menu link
- Back, Next, and Previous links for the REFERRING term archive
- Query posts by multiple custom fields
- WordPress trying to query two custom types to get child from the parent
- Get category list & taxonomy list from different post type using post id?
- Rewrite url post_tag for custom post type
- How to build overlapping custom post_type and taxonomy rewrites without conflicts?
- Single Post (CPT) in two pages – Normal and Extended
- Custom post type based on existing one
- How to add post reference field to a plugin?
- Filter wp_dropdown_categories Per Post Type
- Custom post type clean url
- Custom Post Type Pagination Problem in Admin Section
- Create custom post type with parameters
- CPT Template Not Showing – Getting 404
- Custom Post Type to Upload Images
- Custom Post type easy way for editors
- Two custom post type relations