If you want your custom post type listed under a page you can add the permalink of the page to the rewrite slug like so:
register_post_type('my_books', array(
'has_archive' => false, // Stops domain.com/book becoming the cpt's archive
'rewrite' => array('slug' => 'book')
));
You need to visit Settings->Permalinks
after making any changes to permalinks to re-generate them. You should now be able to visit books under mysite.com/book/my-book-slug
and visit your manually created Page under mysite.com/book
.
Related Posts:
- Remove taxonomy slug from a custom hierarchical taxonomy permalink
- How do I get the permalink of a custom post type?
- remove custom post type permalink
- Shouldn’t this be easy?! Custom post type/custom taxonomy permalink
- WordPress 3.3 custom post type with /%postname%/ permastruct?
- Custom Post type & Taxonomy URL structure
- Combining Multiple Taxonomies in one URL
- Taxonomy term in permalink
- Custom Post Type Archives by Date with Custom Permalink
- Why does a custom post type need the ”hierarchical’ args setting?
- How to modify URL structures in custom post types and taxonomies or terms
- Modify custom post type rewrite rules in a separate function
- Slug for custom post type archive
- Permalink rewrite with custom post type and custom taxonomy
- Make permalinks based on an ACF-field
- Custom permalink with pagination
- Permalinks in Custom Post types
- Custom Post Type with Nested Taxonomy and Template Files
- Semantic URL Custom Post Type and Taxonomies permalinks
- Disable WordPress Recognizing Path as Attachment
- On clicking on the category name the page is redirecting on 404 pge
- WordPress Rewrite rule for nested post types
- Custom Post Type relationship with hierarchical parent and child permalinks
- Passing parameters to WordPress static front page
- Multiple templates for a custom post type
- Possible for Category Base and Custom post Type to share the same slug/permalink?
- How much control do we have over CPT rewrite slugs? Can I create a “root” page for my CPT with out the page path, and then have paths for other pages?
- Removing parent slug in hierachial custom post type
- Wrong generated page_name/slug on first publish of custom post type
- Stop / prevent WordPress from updating permalinks of custom post type
- How do I correct an incorrect permalink?
- Update permalinks when new category added to custom post type taxonomy
- Tag Archive for Custom-Post-Type Posts yielding 404 when permalinks set to postname
- Why doesn’t a custom post type permalink ever hit index.php
- Allow post/page hierarchy across different post types?
- How can achieve this permalink perfectly? domain.com/%category%/%post-name%
- custom-taxonomy/post_name instead of the default post_type/post_name
- Completely remove custom post type permalinks (“One Page” website)
- Custom Permalink to remove category word , keeping posts permalink with date?
- Rewrite Rule for showing Parent/Child Relationship between Two Hierarchical Custom Post Types
- Custom Post Type Permalink
- Permalinks for custom post type
- How to include term custom meta into the custom taxonomy term permalink structure
- Permalinks: custom post type -> custom taxonomy -> post
- Custom Post Fields at the beginning of a Custom Permalink
- Custom permalinks rules don’t match and lost of query var in the process
- Permalink misbehaving in Custom Post Types
- How to Create Template File for Parent Page of Custom Post Type
- I’m having trouble getting the permalink sample on my custom post type edit page to work
- How to hyperlink content from archive page with custom post-type
- How to have permalink like domain.com/term/postname?
- Custom post type permalink sends to 404.php
- Post will not load via ajax
- Template for custom post type when taxonomy is in the URL
- Custom Post Type posts, conflict with posts after add_rewrite_rule to top
- How to change base in tag URL for custom post type, to not use “Custom Structure” set in Permalinks setting?
- Combine multiple CPT names to create valid permalinks
- How to add a sub directory to WordPress single posts without affecting other post types?
- How to filter a custom post type by custom taxonomy without 404
- Pagination of custom post type leads to 404 error
- Which is the neatest way to have homepage articles and a blog?
- Custom Post Type nest under a normal WordPress Page
- Custom rewrite rules for /pastissues/%category%-%postname%.html
- Subpages Permalinks Issues
- Multiple permalinks for a single post with multiple taxonomies
- Stop displaying Permalink
- Permalink with hierarchy of Custom Post Types
- Rewrite URL for CPT to domain/post-name/post-id
- Custom Endpoint For Specific Custom Post Type
- How do you create pillar content pages?
- Custom permalink structure for custom post types including multiple taxonomy
- Custom post type single page returning 404 error when sharing archive url with custom taxonomy
- Customise Permalink Structure For Custom Post Types
- How to make “single post” permalink maintain it’s sub-page structure
- Two and more diffrent custom page type in one permalink
- Some permalinks on Apache/localhost development setup return 404’s when set to anything other than plain permalinks
- How can i remove post type archive URL?
- Page as parent for CPT and other pages
- Two CPT: one is using part of the custom rewrite slug from the other
- Custom permalink with custom taxonomies for custom post type
- Change the url of a custom post type to include taxonomy
- how to use two permalinks for one custom post type based on categories
- Can I override the permalink/slug on creation
- Multiple custom post type and permalink issue
- Remove sequential number from permalinks
- Permalinks when using Custom Post Type with static page for archive
- How to change permalinks to taxonomy and post type’s posts
- Have two (permalinks) urls for a same custom post type
- change precedence of permalink for post_types?
- Redirect permalinks after creating custom post types
- Parent cpt/child custom post type URL permalink relationship
- How to make nested custom post type slugs work
- Custom Post Type Permalinks Problem
- Problems with custom post type and hierarchical permalinks
- Custom Post Types and 404 Pages
- Posts picking up old Permalinks, how to reset?
- Remove slug from Custom Category Permalink + dual-category permalinks
- WordPress Set A Static Page/Template For All Sub-Pages
- Get permalink in custom post type loop doesn’t work
- Have Custom Taxonomy Slug Fall Under Custom Post Type Slug