You can use single_template
filter hook.
/* Filter the single_template with our custom function*/
add_filter('single_template', 'my_custom_template');
function my_custom_template($single) {
global $post;
/* Checks for single template by post type */
if ( $post->post_type == 'POST TYPE NAME' ) {
if ( file_exists( PLUGIN_PATH . '/Custom_File.php' ) ) {
return PLUGIN_PATH . '/Custom_File.php';
}
}
return $single;
}
Related Posts:
- Tips for using WordPress as a CMS? [closed]
- Themes VS Plugins [duplicate]
- A way to sort WordPress themes? [closed]
- Is it possible to use WordPress as an online portfolio for text content? What kind of theme would I look for?
- Creating themes using the one Plugin (Toolkit)
- How to make content as required in custom post type?
- Sage WordPress – Plugin Namespace: Not Found
- WordPress 5 upgrade: until when is it safe to keep project running in 4.x?
- Installing WordPress only for a separate page – ‘mydomain.com/blog’
- Should i delete the posts created by a plugin on uninstall?
- Implement plugins as part of a theme
- How can I list recent posts excerpts?
- How to remove all javascript in a theme wordpress?
- wordpress theme backend admin only
- Allow users mark posts as “complete”?
- Deactivate Plugin on Theme Switch
- Is it possible to group plugins into a folder?
- ‘Customize’ button in admin bar for CSS
- Unable to install theme recommended plugins on Multisite
- Theme or Plugin: Where should I write my code?
- More than one text-domain is being used because of the included templates for plugins
- Is it possible to place custom post type files inside a folder in theme directory?
- Plugin Deactivate Self on Activation Errors
- How to Know if a Plugin can be used with my Theme [closed]
- Is there a way to order posts and custom post types as one group?
- RW Meta Box ,Problem setting post title
- How does WP handle multiple matching rewrite rules?
- how do i remove posts from a WP_Query so the pagination is right?
- Saving Custom Post types and fields to a custom table
- dynamically generating plugin syntax
- Building a store locator with google maps
- Duplicate posts when posting nulls in records in phpMyAdmin [closed]
- Not able to open category post [closed]
- How to make wp_enqueue_style and wp_enqueue_script work only on custom post type
- Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu
- Reusable functions and tools (Framework)
- Accessing post’s meta data based on user’s click of a post
- How To Clean The Malware Infected & Hacked WordPress Websites? [duplicate]
- Do I still need a theme to use page builders?
- How to prevent users to download videos from lms website?
- How to get current post user id
- Only Homepage not loading properly
- How to upload images to WP Panel keeping correct folder in FTP
- Uncode theme content block header ignoring saved changes/not updating?
- Two (or more) looks, with one set of content
- Using custom JS plugins with WordPress?
- Different UI in WordPress
- Theme and plugin install or update display error in localhost
- Re-naming a theme/child theme whilst maintaining updates
- Can I make a super plugin that also has a theme?
- Reduce Drop down Menu Width in WordPress
- plugin style conflicts, how to override? [closed]
- Unable to upload wordpress plugins
- The problem with WordPress Importer
- How to create user groups and allow custom posts and plugin modify/access to specific group?
- How to disable CSS rule in Twentythirteen style.css?
- Correct way to make meta box with more than one meta field secure
- I want to extend the current themes’ single.php to display the meta fields of my CPT
- Plugin custom post type – Internal server Error
- Exclude post by custom meta with pre_get_posts
- Prevent WordPress installing plugins and themes via Admin
- Solutions to repost categories into multisite blogs?
- How can I create a custom shortcode that will return a custom post type by ID?
- Plugin Handle URL With Custom Theme
- Is it possible to create Custom Post plug-in?
- Globally register styles but enqueue them selectively
- get_post_type() and WP_QUERY issue
- How to read individual user’s directory and display content to that specific user?
- Guidelines / restrictions about advertising /donate begging unside wordpress plugins or themes
- get_post_type on post.php
- List taxonomy terms for post as checkboxes
- All of my custom posttypes are 404’ing
- Admin Theme customization
- Hooking in to replace the Sidebar/Widget areas
- more types plugin – display all post of post type on page
- WSOD after upgrading to 3.1
- When using Simple Fields plugin, how do I pull the information out of the database to display on a page?
- How to make a proper custom post type link
- Matching Chapters to a Custom posts [closed]
- Check for security updates
- Custom post type – no layout section of Document tab, and no author choice
- Creating a custom post type, adding custom meta fields, preventing all future editability of posts of this type
- ‘No Results Found’ on single post for custom post type
- Keep a post copy when this one is updated – issue
- Making a Template for a CPT created by a plugin
- how to add a button next to the wordpress view button?
- (FES EDD) New vendor submission page is blank
- There is any way to remove post-format filter? [closed]
- Plugin-generated pages use Not Found or Pages Archive templates?
- Is there any kind of theme on WordPress to sell my own movies?
- Create custom registration form for WordPress Multisite
- Child Pages Short Code plug-in and hover capabilities?
- auto populate list of questions if user select a category xyz
- Classified ad website : which solutions to use? [closed]
- Linux Permissions and Ownership for WordPress
- posts comments goes to trash
- WordPress site periodically goes down
- Masonry images not working
- Advanced Custom Field DatePicker [closed]
- Fatal error: Call to undefined function cmsms_theme_page_layout_scheme()