You can check below code : change Page slug “gym-dashboard” as per your requirement.
<?php
function rt_include_gym_dashboard_page_template( $template ) {
if ( is_page( 'gym-dashboard' ) ) {
return plugin_dir_path( __FILE__ ) . 'templates/content-gym-dashboard.php';
}
return $template;
}
add_filter( 'template_include', 'rt_include_gym_dashboard_page_template', 99 );
Related Posts:
- Loading custom page template via plugin
- Setting a custom sub-path for blog without using pages?
- How to add custom content template part for a custom post type on main query using a plugin
- Add Content to Page without shortcodes
- How to set a fall back template for a custom post type in a plugin?
- How to quickly switch custom post type singular template?
- How to use a dedicated template for the Custom Post Type from a plugin?
- How do I Make a custom post type get a custom post template in a plugin
- How do I create a custom post type for a training CMS in WordPress?
- Create second custom 404 page for selected post type
- is_page_template not working as expected
- Help with CPT template pagination
- Using custom page templates with plugin [duplicate]
- Create Template for Custom Post Type same like for Page
- Getting template_include to work when allow_url_include is off?
- Filter widget outputs
- Custom post type pages return 404 page?
- Main query not querying any posts in custom taxonomy template
- Custom Empty Results page for my Custom Post Type
- Dynamic assign a custom template to custom post type posts
- How to get the current category with custom posts
- Custom permalink structure for remote content pages
- How can I allow users to edit text that will be displayed on a custom post type archive page?
- A certain theme is forcing it’s singular post layout
- Warning , Use of undefined constant PLUGIN_PATH?
- Question on templates
- Custom post type option page template
- get_permalink() of page the enclosing page not posts
- How can I find out what template is my custom post type using?
- Loading a template for a URL pattern
- Show Templates in Custom Post Type Editor
- Custom Homepage As Single Page or Custom Post Type?
- How to avoid hardcoded text in a custom page template?
- Using custom post types within a section of a template
- Custom Post Type Template Based on Page Slug?
- using a template for more then 1 page
- I want to show a list of posts under specified categories
- I want to show a list of post with title that have link goes to that post and icon under the specific category to which it belongs
- How to provide page_template path in custom plugin using WordPress
- tag.php doesn’t work with tags on a custom post type post?
- Assign Page Template Within A Custom Post Type
- Page Templates – this code only works for one Custom Post Type
- Unable to filter on field on edit.php page
- Display posts of child category in template
- custom taxonomy – Template not working
- Create separate template for shared custom taxonomy with shared terms
- template_redirect not working, apparently for no reason
- Custom Post Type slug same as page name causing a conflict
- wordpress 3.4 template files in subdirectories
- I am trying to output portfolio items with a picture. This code doesn’t seem to be working. What am I doing wrong?
- Merge multiple custom post types in a single archive template
- Custom Post Type | Fatal Error on register_post_type()
- Trying to edit the single page from a Custom Post
- Custom Post Type rewrite
- Admin notice not displaying
- Custom Post Type template stored in plugin folder not showing in post attributes dropdown
- create a template page for a post
- Adding a custom post type taxonomy template in plugin
- Plugin: register custom post types, child ready and performance best practices
- Custom post type archive page template
- Getting meta in editor plugin, and event triggering issue
- How to use custom template files in deeper directory?
- How to use TinyMCE Editor for one of my custom post meta field?
- Deleting taxonomy terms and relationships on a custom post_type when a user is deleted
- How can I get this request to use the Custom Post Type page template instead?
- Save Multiple Metabox values
- What’s an efficient way to change the post status of many posts at once?
- How exclude or skip post type with get_next_post_link
- Custom Post Type setup
- Custom Post Type homepage template
- Types plugin custom post add_action hooks
- Display Posts Query with IF function
- custom post template ignored after altering permalinks
- Display ONE taxonomy and its assigned pages
- Not Able to Add New Class To CPT Attachment Image
- Orderby custom fields is not working
- How to stop the custom post type URL from the google search?
- Modify Custom Post Type Slug
- Get all posts by many custom post types
- How can I create a button that when clicked populates a div with a list of foods that are checked as a certain type of ACF?
- Displaying posts inside table having issues
- Having issue on Loading Meta Data From CSV to CPT
- custom data model – link and populate from admin backend
- Custom taxonomy template for custom fields loop [closed]
- WordPress Custom Post Type – Post Attribute: Template. Template shows up and saves on the back end, but the default theme file is being rendered
- call a function when insert and update a custom post type
- Custom post type with two templates
- Custom Post Type tag taxonomy “Page Not Found”
- Registering an optional custom post type from a plugin
- custom fields not showing before get_header
- Custom Post Type Pagination Not Working or Single Posts Displaying?
- Generate custom RSS from a plugin
- Load different template for CPT (in loop) in my plugin?
- Modifying and Displaying URL’s in a Post Template using parse_url
- Most appropriate way to display CPT’s by children terms of custom taxonomies while retaining desired permalink structure?
- CPT Template Option to Top
- Adding custom theme template to custom post type [duplicate]
- Menu Structure and URL structure, with Pages and Post-Type-Posts
- Custom Post Type urls not working
- Why isn’t page attributes dropdown not showing up in a custom post type