Add CPT Templates somewhere other than theme directory?
-
I want to add a new CPT to a theme. I want that theme to be as “self-contained” as possible, in the event I need to activate a different theme in the future.
The conventional way of doing that would be to add the CPT’s archive and single pages in the a child theme.
The problem with that is that if I activate a new theme, I would have to move the templates over. If left up to a client, this would likely break their site.
I would like to make a custom plugin to add the CPTs (easy enough), but also add the archive and single templates in the plugin directory, instead of a child theme directory.
Is there a hook I can use that will let me add the templates in a plugin directory instead of the theme directory?
- The topic ‘Add CPT Templates somewhere other than theme directory?’ is closed to new replies.