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]
- Remove slug from custom post type post URLs
- Hook for post and page load
- WP_Query Pagination on single-custom.php
- Restrict custom post type to only site administrator role
- Add extra parameters after permalink?
- What is singular.php?
- Submit post and upload image from front-end
- How to get post content by calling ajax?
- How to show all posts of the category in wordpress?
- Get the ID of the latest post
- Possible to change the URL for the regular post type without affecting the URL of other custom post types?
- Change permalinks for posts but not for custom post types
- Front end post editing using a form
- Linking Two Post Types
- How can I convert Posts into Custom type posts?
- Set posts of a custom post type to be private by default?
- What are the differences between custom post type and custom page templates?
- Enable sticky posts to custom post_type
- How to force one column layout on custom post type edit page?
- Page Template as Custom Post Type Archive
- Limit the word count in the post title
- Correct Post Count ( All | Published | Drafts | Pending | Trash ) for Custom Post Type when restricting to view own posts
- Fetch All Posts (Including Those Using a Custom Post Type) With WordPress API
- Make featured image required
- previous_post_link() and next_post_link() with a custom post type?
- Get category id from post id of a custom post type
- How do I add a new custom post format?
- Add Content to Page without shortcodes
- How to add a button to custom post type’s posts-page
- How can I add a column/s to wp_posts table?
- Loading custom page template via plugin
- WordPress REST Create Post of Custom Type
- Post formats “audio” and “video” only showing in index.php
- Ordering Posts List By Taxonomy Terms?
- flush_rewrite_rules on save_post Does Not Work on First Post Save
- How make get_next_post() return first post when viewing last one
- Creating a Custom Post Type for Inserting Preset Content into Post & Pages?
- Limit widget to a specific registered sidebar
- WP_List_Table Inside Metabox Not Working on Submit
- WordPress keeps fetching the archive page instead of the template page
- post_row_actions for custom post type
- Pull Two Posts Into Custom Post Type `single-cpt.php`
- Why get_next_post_link() or get_previous_post_link() doesn’t return the required links?
- How to add custom template in plugin?
- Add metabox with media uploader in a custom post type [duplicate]
- Edit the “Post updated. View post” link
- How to quickly switch custom post type singular template?
- modify all posts of a category to “no comments allowed”
- Getting a div content of a post in wordpress?
- Limit the post for differents custom post type in the same wp_query
- Add a Template to a custom post type
- Problem excluding category from get_next_post
- How to use a dedicated template for the Custom Post Type from a plugin?
- How can I add dropdown widget/box to admin post page?
- WordPress calls archive page instead of Custom Page Template
- How do I Make a custom post type get a custom post template in a plugin
- How to sort list of custom posts to get view like a tree of posts under categories and their children’s categories?
- How to hook get_terms() to only show count of posts that have custom meta
- Why is the »_builtin« parameter not advised in »register_post_type()« for custom post types?
- How Can the Users Make a “Playlist” of Posts?
- Assign Page Template Within A Custom Post Type
- Dynamic page.php template for custom post types
- Create Post tabs in single-{content-type}.php with Custom Field values
- Showing current taxonomy terms
- Custom Posts on Different Pages
- Custom post type archive and single.php files not working
- Custom permalinks – post type – hierarchical taxonomy’s
- Newer/Older posts links display same posts on every page
- taxonomy list display custom post count
- Page Templates – this code only works for one Custom Post Type
- Pagination on a custom page template
- Loading post content in FancyBox
- automatically create taxonomy with same name as post title
- How to let custom post type posts show in standard post archive (like in homepage)?
- Rewrite custom post & taxonomy to share same URL path
- How do I write this SQL statement for Posts written in last 24 hours?
- Custom Post Type – Archive page title
- custom sortable column
- WordPress custom post type Single.php?
- How to show related posts by category or custom post type?
- Downsides to not using built-in “Posts” post type?
- 960gs different classes on teasers posts
- Assigning a role to a specific custom post type (and ignoring other post types)
- Wp-query causing problems with the_content();
- Display posts in random post types
- Custom Post Type by user
- Structuring a product catalogue in WordPress [closed]
- saving custom post type data to different table in wordpress
- How to create posts (not post template) to be displayed on projects page?
- Multiple templates for custom post type
- Display “Post 2 of 4” on single post page?
- Query post types with multiple keys
- ascending order custom post type
- How can I fix a slow redirect after form submit from frontend (no plugin)?
- How do I create a custom post type for a training CMS in WordPress?
- add_meta_box: Datepicker like the one for postdate?