Okay so I have resolved this by combining several different wordpress functionalities:
- Catches the template include conditionally
add_filter( 'template_include', '...' );
, in my case based on a regex match of the expected URI pattern locate_template('example-template.php')
to then resolve my (essentially) static template- A query within my
example-template.php
that externally retrieves the resource - This must handle 404s interally as the response will always assume the post can’t be found, I am always setting the header response (before
get_header
in the template to202
where the resource is found. - Example;
if ($resource) { @header($_SERVER['SERVER_PROTOCOL'] . ' 202 Accepted', true, 202); }
Bit convoluted, but really not too much work for what I required.
Related Posts:
- how to use two permalinks for one custom post type
- Clean URL permalink for custom post type
- WordPress custom post type permalink rewrite shows page not found
- Using page title as a link to term archive
- I want to rewrite the URL of a specific post with a specific custom field to easily analyze in Google Analytics
- On saving Post My permalink is updated and category is removed automatically which cause the 404
- News post with multiple permalinks? When opened from different page
- Dynamically change Custom Post Type Template OR Change Permalink?
- PHP Button Custom link [closed]
- How do I get the permalink of a custom post type?
- Shouldn’t this be easy?! Custom post type/custom taxonomy permalink
- WordPress 3.3 custom post type with /%postname%/ permastruct?
- 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?
- Modify custom post type rewrite rules in a separate function
- How do I programmatically add items of content to a custom post type?
- Permalink rewrite with custom post type and custom taxonomy
- 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
- How can I programmatically save data into custom fields that contain serialized data?
- Row actions not showing? Why?
- Displaying custom post type on front page
- How to allow “Add New” capability of CPT when links to its UI are placed as a submenu?
- Passing parameters to WordPress static front page
- Dynamic Custom Post Type Plugin
- How to filter out post type meta?
- 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?
- Weird problem happening with custom taxonmy when creating/updating posts
- Removing parent slug in hierachial custom post type
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- Wrong generated page_name/slug on first publish of custom post type
- How do I correct an incorrect permalink?
- Update permalinks when new category added to custom post type taxonomy
- Get posts from a custom post type by child categories of a parent category
- CPT + CMB2: data not displaying for only first post in loop
- Why doesn’t a custom post type permalink ever hit index.php
- Query & Order posts by custom fields
- How can achieve this permalink perfectly? domain.com/%category%/%post-name%
- custom-taxonomy/post_name instead of the default post_type/post_name
- ACF field key/value to show on taxonomy list
- Custom Permalink to remove category word , keeping posts permalink with date?
- Rewrite Rule for showing Parent/Child Relationship between Two Hierarchical Custom Post Types
- How to include term custom meta into the custom taxonomy term permalink structure
- search suggest – filter post type
- Configuring a meta query with multiple post types that have the same relationship on a single page
- Custom Post Fields at the beginning of a Custom Permalink
- Permalink misbehaving in Custom Post Types
- Trying to get custom post of a custom taxonomy
- I’m having trouble getting the permalink sample on my custom post type edit page to work
- Loop increase number
- Remove custom permalink structure from custom post type without modifying register_post_type() directly
- Is This Code Efficient – Or is there a better way?
- Show current user posts in custom post type query
- Rewrite permalink for multiple post types (CPT) with taxonomy term
- Custom Post Type with modified permalink structure results in 404
- Custom Post Type Pretty Structure
- CPT, meta-data, url parameter
- Change permalinks for custom post type based on taxonomy term
- Safe to throw 404 error in request filter?
- Sets post_parent in custom post type posts automatically based on cpt->page name
- How to use taxonomy term as permalink folder
- Show the categories the current post has
- WP 3.1 custom post type permlinks
- Front end create custom post types
- How to display “Trash” in my custom post type?
- Why is my custom post content only viewable when signed into WordPress?
- 404 error rewrite permalinks
- Query custom post type that has a serialized relational advanced custom field value
- Pagination not working in custom post type. Help
- Sending current featured image to email
- Plugin Development using classes – Public & Private Callbacks
- Finding the CPT archive template source
- How to prefix custom post type URL with custom post taxonomy term?
- How to use posts as tabs in a custom page?
- CPT and rewrite rules
- Custom post type single with custom URL structure
- WordPress trying to query two custom types to get child from the parent
- Wrap each child and it’s grandchildren separately
- Pagination not working (page/2 retunring 404 page)
- How to redirect CPT permalinks from ID to default pretty permalinks?
- Custom post type slug as page slug
- WordPress custom post type rewrite rule matches all pages returning 404
- Multiple archives for cpt, taxonomies, terms
- Why isn’t my custom post type using the corresponding custom post template?
- Single page problem when permalink type changed
- Custom post type using standard post categories results in 404 when viewing /cpt/category
- Order by custom field attribute
- Change Taxonomy Permalinks
- Cant we use a PHP file directly like myhome.com/some.php?
- Change permalinks for posts but not custom post type?
- Code in custom widget queries all posts, when it should only query the current post
- How to hide home title on pages and posts?
- Get permalink in custom post type loop doesn’t work
- How to add custom permalink struct with DYNAMIC author to a Custom Post Type
- Permalinks for Custom Post Types and Taxonomies