You can have a separate slug for the post type archive by setting the slug as the value for the has_archive
argument, instead of just true
:
register_post_type(
'event',
array(
'has_archive' => 'agenda',
// etc.
)
);
Now you can use single-event.php
and archive-event.php
for the single and archive views, but the URL for the archive will be siteurl.com/agenda
.
Related Posts:
- Rewrite Custom Post Type URL slug
- Custom post type and taxonomy permalinks – Structure
- Show index and not the archive for “Dog Custom Post” with default slug
- URL Rewrite Adjustment for Custom Post Type causes template to revert to index.php
- My archive-posttype.php template is not loading
- Custom Post Archive is not working
- Custom post type archive with page as parent url
- Permalink misbehaving in Custom Post Types
- Best way to specify “article type” in URL
- Pagination custom post type not working with rewrite slug
- Custom Rewrite Rule for Custom Post Type with URL Param
- WordPress custom slug rewrite
- Which Template Page Should I Use?
- Custom Empty Results page for my Custom Post Type
- Display custom post types in wp_list_pages
- Custom URLs in post types make it impossible to view archive
- Pagination doesn’t function properly for archive of a custom post type set as the front page
- I can’t access custom taxonomy page listing
- How to have permalink like domain.com/term/postname?
- Custom Permalinks for Custom Post Types
- post_type_link Filter – Too Few Arguments
- Postname on unique permalink structure appends “-2” for a custom post type. How can I get this to stop happening?
- Share root slug for Child Page and Custom Post Type (prioritizing child pages over posts)
- How to integrate single and archive templates for custom post type in any WordPress theme
- Combine multiple CPT names to create valid permalinks
- WordPress Custom Post Type – Rewrite Query
- After creating Custom post type by user delete old one
- Set parent for custom post type archive rewrite url
- Route subpage to Custom Post Type
- Custom Post Type Category URL
- Add term slug in URL of custom post type details page
- Programmatically add custom field to post_name in a custom post type
- Custom Post Type Template Hierarchy – Single post template
- Custom Post Type Advanced Slug
- Templates for hierarchical custom post type
- Custom post type permalink uses archive page to display posts
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- Dynamic CPT permalink structure based on ACF field value
- How do I know if a rewritten rule was applied?
- How to create custom search result page with custom URL parameters for custom post type?
- WordPress rewrite url
- Taxonomy template page not working
- Page inside custom post type (url rewrite?)
- URL Rewrite – Page Archive
- url rewriting for custom post types
- Rewrite permalink for multiple post types (CPT) with taxonomy term
- Post type Permalink
- How to constrain the results to a specific post_type on tag archive page?
- How Can I Remove Custom Post Type Slug From URL
- WordPress custom permalink and archive link for custom post type
- How to rewrite the post slug of a custom post type post
- CPT with its own category and tag url
- get_post_permalink() and custom permalink rewriting
- rewriterule not working
- Urls in Custom Post Type work for Terms but not for its Taxonomies
- Custom Post Type Archive template not being called
- Custom Post Types and Removing Slugs – should we do it?
- Custom post type URL
- Pagination for custom post types – url rewriting
- Can’t replace the default sidebar with a custom sidebar on Custom Post Type in Genesis
- Custom Post Type homepage template
- Modifying rewrite rules to use /category//
- Custom Post Type View Button in Admin Gives 400 Error
- Getting custom taxonomy posts on archive page
- Add Custom Values to Permalinks Through Custom Fields and Posts
- Taxonomy rewrite pagination 404
- Archive page for custom post type and custom taxonomy
- Custom Post Type URL Rewrite’s
- Why does my URL keep returning 404 error code?
- Custom Post Type nest under a normal WordPress Page
- How do I override the default number of items to be listed on an archive.php page? [duplicate]
- Custom post types templates
- Custom Post Type Date Based Archive URL rewrite [duplicate]
- custom post archive URL is wrong
- Best way for a plugin to define a custom post type archive template?
- Rewrite rules for custom post type
- Custom taxonomy and post type rewrite rules
- Custom rewrite rule takes place AFTER the generic category rule
- Combine 2 different custom post slugs into a single permalink?
- Custom Post Type and Taxonomy Rewrite Error
- restricting custom rewrite to just one custom post type
- custom posts permalinks url rewriting
- Use a different URL path / permalink for CPT
- Is possible register two archive pages for single custom post type?
- WordPress is ignoring my post rewrite rule
- Url Rewriting a dynamic wordpress page with parameters
- returning the currect URL for nested posts
- Adding /blog in front of single posts (only)
- Archive page of taxonomy returns a 404 error
- Setting Parent Page to Post
- Add rewrite rule for custom post type single page
- Custom taxonomy terms as children of multiple custom post types
- Remove cpt slug from url and use custom taxonomy instead breaks all other cpt
- Archive page of CPT’s custom Taxonomy
- Pagination links for custom post type shows correct number of links, but links result in Page not found
- Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
- multiple URLS for the same page
- 404 error rewrite permalinks
- I want to rewrite the URL of a specific post with a specific custom field to easily analyze in Google Analytics
- Rewrite URL for CPT to domain/post-name/post-id