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.

Cross posting my trac question here in the slim hopes that someone here has run into the same issue and has already come up with some proof of concept code I can try:

In building a custom 'theme plugin' for bbpress I was just made aware that it is impossible for a plugin to 'transparently' add/append template files to the currently active theme or child theme.

I'd like to request the enhancement where when a theme is looking for a custom template such as single-forum.php to search a plugin folder if it is not found in the child theme or parent theme.

I'm thinking of some type of action where my plugin can say 'add me' to the list of places you are looking for templates.

If my understanding is correct, when WordPress is looking for a template it starts in the child, then the parent theme but ends there.

Why? If I have a user manually add all of the custom templates needed to their current theme, and they update their theme, they will loose all the templates they manually added.

This means I have no way of giving a user custom theme templates that won't be lost when upgrading, thus requiring them to manually add the templates back in every time they upgrade their theme.

What it really means for me is that there is no real path for me to create custom bbpress templates for users where I don't have to worry about them loosing them.

I can go the route that bbpress currently uses in this situation which is that bbpress uses the themes page.php template and replaces the_content(). The problem is I am stuck with whatever is included in the active themes page.php file.

*for instance twentyten has the title hardcoded in and the call to the sidebar, which I can't remove

I can't go the child theme route, because I have to assume that they are already using a child theme.

Another dev told me today that this issue came up about 2 years ago. I am praying that there was proof of concept code somewhere that I can try to utilize. Does anyone happen to know if concept code exists anywhere? strong text

share|improve this question
    
I don't know how bbPress intercepts the template hierarchy, but if you tell me the function, then I'll improve this Answer here. –  kaiser Feb 3 '12 at 5:22

1 Answer 1

up vote 0 down vote accepted

There isn't an easy way to do this at this time. Check out this question's answers for some potential work arounds.

share|improve this answer

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.