You need to use add_rewrite_tag
and add_rewrite_rule
functions to first register your custom URL handlers.
Something like
add_rewrite_tag( '%custom_render%', 'true' );
add_rewrite_rule(
'([^/]+)/custom_render/?$',
'index.php?name=$matches[1]&custom_render=true',
'top'
);
And then you can us template_inclide
hook to check if the query param custom_render
is set, then return the name of the new template.
Note: You need to flush your rewrite rules after making changes.
Related Posts:
- Setting a custom sub-path for blog without using pages?
- How to change Elementor Template for Single Page Post on Load
- Custom post Query and WordPress Post Query Clash
- What does this PHP function code mean? [closed]
- Get the ID of the latest post
- Change permalinks for posts but not for custom post types
- Front end post editing using a form
- Set posts of a custom post type to be private by default?
- Add Content to Page without shortcodes
- How make get_next_post() return first post when viewing last one
- modify all posts of a category to “no comments allowed”
- Getting a div content of a post in wordpress?
- How can I add dropdown widget/box to admin post page?
- Assign Page Template Within A Custom Post Type
- Custom permalinks – post type – hierarchical taxonomy’s
- Page Templates – this code only works for one Custom Post Type
- Custom Post Type – Archive page title
- How to show related posts by category or custom post type?
- ascending order custom post type
- add_meta_box: Datepicker like the one for postdate?
- [Plugin: Posts 2 Posts] Changing display order of connections
- Display taxonomy term only if there’s a value
- How to show post title outside of loop? [closed]
- How do you use JavaScript to detect the homepage
- Custom Post Type slug same as page name causing a conflict
- How to delete all posts from a custom post type?
- Update content of multiple pages/posts at once?
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- Help with CPT template pagination
- CPT’s archive and single page not working [closed]
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- Trying to edit the single page from a Custom Post
- How to Submit Post Via cURL & PHP
- apply filters only to specific post listing without check the url parameters
- How Can I Set the Post Author of a Post I Just Created With PHP?
- is there a way to retrieve posts that do not have a featured image assigned?
- create a template page for a post
- Custom post type archive page template
- Post image in WordPress not appearing on home page
- How to sort posts in a custom post type by title in ascending order by default?
- Conditional for a Single Post That Belongs to a Category?
- $post not working working in AJAX plugin with custom post type
- Multiple pages per post (not pagination)
- Variable not working in WP_Query
- What’s an efficient way to change the post status of many posts at once?
- Query within a foreach within a query (queryception)
- How to implement a different permalink structure for custom post type?
- WordPress notification if new post published
- How to handle new post from API request?
- Restrict category access to specific users/groups. Author always has access
- Render a Post or Page using the correct file
- WordPress Count posts within a custom post type
- Copy/Move selected taxonomy terms to another taxonomy for posts
- Enabling permalinks disables custom page template
- WordPress post carousel
- Custom post type tags not showing in search
- How to setup different permlalinks for posts and pages?
- custom post template ignored after altering permalinks
- Display ONE taxonomy and its assigned pages
- Search CPT by tag ids
- Post template with breadcrumb needs to show page navigated from
- Define multiple prefixes for custom post type
- Publishing failed. The response is not a valid JSON response
- add all blog posts to folder
- WordPress Page hierarchy ( parent is singular of custom post types slug ) is returning not found
- Show posts from WP Custom Post Type selected from a field in a metabox
- Custom post type not pulling CSS
- order custom post type posts by custom date
- How to show posts of the same category on a page?
- Assign a Post to a User
- custom post type to post association in wordpress
- Need to display author’s email id in the “Edit post” field in wp dashboard. How do I do this?
- Use WP pagination functions on a custom page template
- How to get all posts related to a taxonomy?
- call a function when insert and update a custom post type
- Work and Display a Custom Post Type as a normal Post
- Most efficient way of showing children posts?
- Custom post type with two templates
- One Post with different content, depending on a Page
- Custom Post Type
- custom fields not showing before get_header
- Popup panel is only displaying 1 entry ignoring all others
- Custom Post Status & Taxonomies
- How to display data with pagaination on backend?
- Edit post meta direct from post.php?
- Custom Post Type Pagination Not Working or Single Posts Displaying?
- How to Arrange Support => Thumbnail
- Front-end form submission not creating post
- Post being scheduled that shouldnt be schedulded
- Modifying and Displaying URL’s in a Post Template using parse_url
- Get custom post type parent category
- How to delete unnecessary custom post types in the UI
- show the most recent date of all posts to display on front end
- Adding custom theme template to custom post type [duplicate]
- Error 403 when posting comments to a custom post type from a different page
- How to make a non-public post on wordpress approval?
- How Do I Add a Custom Post Type URL to Content?
- is therer any wordpress function to retrieve a specific html element from post content
- Post content in bootstrap modal
- display related posts based on the PAGE TITLE