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.

I'm creating a parent theme and several child themes. But how can I prevent the parent theme from ever being used?

share|improve this question
    
It might help get a better answer if you explain your use case of not wanting the parent theme from ever being used. –  Chris_O Apr 28 '11 at 11:34
    
I'm guessing that he doesn't want anyone to be able to select the parent theme from the Themes admin selection page. –  anu Apr 28 '11 at 12:52
    
The parent theme provides common functionality for all the child themes - say 90% of the templates. But it wouldn't make sense to use it on its own. –  Marcus Downing Apr 28 '11 at 17:24
    
sounds like "abstract themes" –  aldo.roman.nurena Jul 31 '13 at 6:08

3 Answers 3

up vote 2 down vote accepted

Not using the current system. In order to serve as a valid Template for a Child Theme, the Parent Theme must exist, and be a valid Theme. That's because the Parent Theme's template files must be accessible via locate_template(), in order for the Child-Parent fallback to work properly.

Note: if this core Trac ticket is implemented, then you'll be able to filter locate_template(), which would conceivably enable you to put your Parent Theme in a separate location, not accessible by Dashboard -> Appearance -> Themes.

share|improve this answer

would - by ensuring the child theme had all the same template pages as the parent and by not including the @import of the parent css - be too dumb of an answer?

share|improve this answer
    
that's an interesting approach, but then you start to lose the benefits of having a parent theme at all - at some point you might as well just clone the theme and make changes directly! –  anu Apr 28 '11 at 12:53
    
You have to get creative & interesting in order to achieve something you have no knowledge of how to do lol –  Screaming Violet Apr 28 '11 at 15:32

You can't hide the theme itself, but you can control access to the theme switcher:

http://codex.wordpress.org/Roles_and_Capabilities#switch_themes

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.