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 question already has an answer here:

I'm developing a plugin. This plugin creating a new post type and displaying these posts in a custom template.

For example it's a event calendar plugin. This plugin creating a new post type 'event '. Users adding new events from wp - admin, like normal blog posts. And users creating a new page with 'Event Calendar ' page template.

But for enabling Event Calendar page template, users have to copy eventcalendar.php from plugin's dir to their template's dir.

Last step (copying file) is really hard for some users. Is it possible to call custom page template from plugin dir?

share|improve this question

marked as duplicate by kaiser, toscho Aug 16 '13 at 16:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

add comment

2 Answers 2

up vote 2 down vote accepted

I second Tom's answer, however in the interest of answering your question, have a look at this question using the template_include filter.

share|improve this answer
    
Thank you template_include() solve my problem. –  Eray Apr 6 '12 at 22:39
add comment

Probably, but I would advise against this as you would have to make a template that worked with every single theme out there which is not possible. Many people will have broken templates no matter what you do.

Instead try adding a shortcode as a backup for those users who can't do that additional step.

share|improve this answer
    
i solved my problem with template_include(). Thank you. –  Eray Apr 6 '12 at 22:38
add comment

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