You can kind of fake it before the main query is run with the pre_get_posts action:
function wpa84126_single_project_archive( $query ){
if( ! is_admin()
&& $query->is_main_query()
&& $query->is_post_type_archive( 'new_projects' ) )
$query->set( 'name', 'my-new-project' );
}
add_action( 'pre_get_posts', 'wpa84126_single_project_archive' );
Make sure to change new_projects to the actual name you’ve registered the post type under. It will still behave in every way as if it’s the archive page, but only that single post will be queried. You could save the slug in an option so you could change it without having to edit the code.
Related Posts:
- How to remove slug from hierarchical custom types in 3.5.2
- Custom post type yearly/ monthly archive permalinks
- Meta_Query as a way how to setup CPT permalinks – is it a good thing?
- How can I rewrite URLs to pass taxonomy and post type values to the query?
- Is it possible to change the URL of custom post types to hide the post type slug?
- Removing base slug from hierarchical custom post type
- Rewriting ‘rewrite’ slug for custom post type used by plugin
- Adding meta values to permalink
- WordPress custom taxonomy URL rewrite on spelling errors
- How can i avoid the permalink start with ‘blog’ while using the custom post type?
- Custom Posttype Inheritance (and url structure)
- Adding %author% in custom post type URL structure?
- How to have a custom URL structure for a custom post type?
- Display CPT taxonomies as an archive page
- Permalinks for CPT breaks permalinks to pages
- WordPress custom post type url change
- Including two taxonomies in a permalink structure
- WP Rewrite Rules – Custom post type & taxonomy
- Changing a custom post type “has_archive” after registered
- URL Design for Sub-Posts?
- Remove base slug in CPT & CT, use CT in permalink
- How do I list terms of a custom taxonomy at i.e. domain.com/brands/
- Permalink Structure problem with cpt and custom taxonomy
- Custom Taxonomy 404
- Custom Post Type rewrite redirects to homepage
- Custom Post Type slug same as page name causing a conflict
- single-{post_type}.php is not loaded despite flushing rules
- Adding paged query to custom URL rewrite
- Custom Post Type rewrite rules not working, how to alter the rewrite order?
- Custom Permalink for Taxonimie and Custom Post Type
- Rewrite Custom Post Type URL slug
- Rewrite numeric ID parameter for hierarchical custom post type
- Customising rewrite rules for CPT single post URL to work as paged URL
- Remove custom post type slug not working for child pages
- Custom WP TItle from custom template with dynamic URL structure
- Rewrite rules for custom post type slug
- In WordPress how do you create a custom post type with the author’s name in the slug?
- Change URL of posts and also Custom Post Type
- Custom Post Type rewrite
- How can I display an archive of only one category of my custom post type?
- Permalink Structure CPT With Custom Taxonomy Fails
- Conditionally custom post type url rewrite
- Making a custom help center page
- Remove url rewrites for registered taxonomies
- Get Taxonomy Term Title by it’s URL
- Can’t get custom rewrite tag, query var, permastruct (permalink structure), and rewrite rule to work properly together
- How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?
- WordPress custom post type permalink rewrite shows page not found
- Using taxonomy term in CPT permalink – Pages 404’s
- Customize Custom Post Type URL
- Programmatically rewriting slug through functions.php but returns 404
- Custom Permalinks with CPT and Hierarchical Taxonomies
- Why isn’t my custom post type archive URL translating?
- Custom Post Type and Category Base Rewrite Issue
- Rewrite URL of Custom Post Type for Jobs
- Post Type rewrite rule to point to custom Page/template
- Custom Permalink Structure for Custom Post Type, Custom Taxonomy, Under a page
- Specific routing for CPT
- Lost of query parameter when using permalink
- Custom permalink with child taxonomy terms
- Custom post type archive with page as parent url
- Pagination custom post type not working with rewrite slug
- Custom Rewrite Rule for Custom Post Type with URL Param
- WordPress custom slug rewrite
- 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
- Dynamic CPT permalink structure based on ACF field value
- URL Rewrite – Page Archive
- Urls in Custom Post Type work for Terms but not for its Taxonomies
- custom post archive URL is wrong
- Rewrite rules for custom post type
- Custom taxonomy and post type rewrite rules
- Custom Post Type and Taxonomy Rewrite Error
- custom posts permalinks url rewriting
- WordPress is ignoring my post rewrite rule
- Url Rewriting a dynamic wordpress page with parameters
- Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
- I want to rewrite the URL of a specific post with a specific custom field to easily analyze in Google Analytics
- Duplicate content problems after adding an archive page to the article’s post type
- Display CPT taxonomies as an archive page
- CPTUI rewrite disable when no post in CPTUI has been found
- Redirect Custom Post Type from Child Taxonomies
- Set archive of custom post type like ‘posts’ page in reading settings is set
- Register post type getting error 404
- Custom post type rewrite and wp_pagenavi interfering with each other
- CPT url rewriting : regular posts return 404 error
- redirect old post type url to new structure url
- One custom post type with two different url structure base on taxonomy term
- Why is a custom post type’s URL “/?cposts=name-of-the-post” but default post’s URL is “/?p=ID”?
- How can you preserve URLs when moving posts to a custom post type?
- Custom Post Type Base URL
- Custom Post Type and single-posttype template
- Custom Post & Taxonomy rewrite break regular post & page
- Custom slugs with dates & IDs on Custom Post Type
- Add post id to url instead of WordPress default -2 suffix
- Custom URLs between different post types, using “Pods”
- CPT with URL rewrite showing as 404
- How to add random prefix (based on related page slug) to custom post type?
- Rewrite taxonomy permalink appended to CPT archive url