Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

This is probably totally off the wall, but I want to create a new wordpress plugin, that will have its own subset of templates and pages. Whats the best way to do this? The plugin will be used on three pages of the wordpress site. It will use the same theme, though It will have three different page templates. Is it possible to group the templates together in a sub-folder inside the theme or plugin. The pages will be static ie dont need to be available to wp-admin.

How it currently is.....

option a -> templates in theme root, using wordpress page admin.

Below is two ideas of how i'd like it to be....

option b -> sub folder in theme with static pages (No need to create/edit in wp-admin).

option c -> self contained templates inside plugin folder using current theme, and custom filters/ actions with static pages (No need to create/edit in wp-admin).

This plugin is essentially a section of the wordpress site grouped together that uses the wordpress objects and database. It will have its own loops and pages.

/wp-content/plugins/mycustomplugin/mycustomplugin.php
/wp-content/plugins/mycustomplugin/templates/default.php
/wp-content/plugins/mycustomplugin/templates/template2.php
/wp-content/plugins/mycustomplugin/templates/mycustomplugin-loop.php

or

/wp-content/plugins/mycustomplugin/mycustomplugin.php
/wp-content/themes/mytheme/mycustomplugin/mycustomplugin.php
/wp-content/themes/mytheme/mycustomplugin/template2.php
/wp-content/themes/mytheme/mycustomplugin/mycustomplugin-loop.php
share|improve this question
add comment

migrated from stackoverflow.com Aug 11 '11 at 20:22

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 1 down vote accepted

If this is a plugin you should really keep the files in your plugin folder. Alternatively you can use the theme folder under it's own name separate from the active theme. I have seen the latter done and it works fine but you don't want some unsuspecting users to activate it by mistake. You should never write to the active theme or any theme the user has installed.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.