• John

    (@sidewindernet)


    I am developing a plugin that requires a custom page template. I followed the instructions on Creating Your Own Page Templates and it works as it should. However, when I distribute the template, I have to include in the README that file foo.php needs to be uploaded into your themes directory for this plugin to work, which is less then ideal. Is there anyway I can keep foo.php with the plugin, and have WordPress recognize that there is a page template in the plugin directory or do I have to wait for register_theme_directory?

Viewing 1 replies (of 1 total)
  • Interesting question. I don’t know the answer but you might be able to use one of the early hooks to load your page. I’ve also been looking at /wp-includes/theme.php. There are a lot of actions and filters in there. Possibly one of those could be used to pull this off. I kinda wish I had to jack with it.

    What I’d like to see is a register_additional_theme_directory or even an automatic check of /wp-content/plugins/pluginname/themes/ for template files. I should add that to my list of feature requests.

Viewing 1 replies (of 1 total)

The topic ‘Different page template location’ is closed to new replies.