WP uses whatever theme is activated. If your activated theme is a child theme of twenty eleven, there will be a comment block inside your child theme’s style.css file that says that twenty eleven is the parent. So when looking for a file, WP looks first in the child theme and then, if it doesn’t find it, in the parent theme, which is twenty eleven in this case.
If you changed your child theme to say that another theme was its parent (say twenty ten, for example), then you would get that theme’s output for everything except the stuff in your child.
Cheers
PAE
Thanks for the answer … but …
I just created that folder, and in themes appeared my theme, twentyeleven and twentyten. And I activated my theme (header.php, style.css and logo.png in that folder).
And the site works on the twentyeleven layout. I also deleted style.css and still works on twentyeleven layout, of course the text is not formatted but the layout is twentyleven.
That’s intriguing me, why is still used twentyeleven layout.
It works on the twenty eleven layout because it hasn’t found anything in the child to overwrite what’s in twenty eleven.
If you delete your style.css file your child theme will no longer be found. It therefore cannot be activated and so WP will fall back on twenty eleven, which is currently the default theme.
Cheers
PAE
So by default twentyeleven it’s default theme even I didn’t specified.
And when there will be a twentytwelve theme it will work on twentytwelve.
How do I specify in this case to stick to twentyeleven ?
Thanks again.
Well, there has to be a default, otherwise what would WP do when first installed?
Once you’ve activated a theme, that’s the one WP uses. The installation activates twenty eleven, but what you’ve done is returned WP to the situation where no theme at all is activated, because you’ve effectively scrapped your child theme without activating another one. So WP falls back to the default.
So you don’t need to specify anything.
Cheers
PAE
Thank you very much now is clear.
So that’s how it works a child outside a theme.
In style.css from themename2 to specify which theme is used
/*
Template: themename1
*/
Then to activate themename1 which has all files, and after to activate themename2 which has only somefiles to overwrite the themename1 styles.
Thanks again.
Nope. A child theme must contain a style sheet comment block like this:
/*
Theme Name: Twenty Eleven Child
Theme URI: http: //example.com/
Description: Child theme for the Twenty Eleven theme
Author: Your name here
Author URI: http: //example.com/about/
Template: twentyeleven
Version: 0.1.0
*/
See http://codex.wordpress.org/Child_Themes
Only the Theme Name and Template lines are mandatory.
A parent theme would contain a comment block like this:
/*
Theme Name: Twenty Ten
Theme URI: http://wordpress.org/
Description: The 2010 default theme for WordPress.
Author: wordpressdotorg
Author URI: http://wordpress.org/
Version: 1.0
Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu (optional)
License:
License URI:
General comments (optional).
*/
See http://codex.wordpress.org/Theme_Development
What you were quoting was the comment block for a custom page. Not the same thing at all.
And also no about activation. Only one theme can be active.
HTH
PAE
Thanks peredur.
And here are more resources for anyone also interested in this topic.
http://op111.net/53/