• I’m new to wordpress and just installed it.

    In themes folder I have twentyten and twentyeleven.
    I’ve created a new folder mytheme and copied there header.php, created a style.css which I import style.css from twentyeleven and a image logo.png to replace the top text with a image.
    How the wordpress know to use by default twentyeleven theme by default and not other theme, cause when I refreshed the website it works only with those 2 files, but with twentyeleven theme layout.

    Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • 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

    Thread Starter simi_id

    (@simi_id)

    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

    Thread Starter simi_id

    (@simi_id)

    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

    Thread Starter simi_id

    (@simi_id)

    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 https://codex.www.ads-software.com/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: https://www.ads-software.com/
    Description: The 2010 default theme for WordPress.
    Author: wordpressdotorg
    Author URI: https://www.ads-software.com/
    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 https://codex.www.ads-software.com/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

    Thread Starter simi_id

    (@simi_id)

    Thanks peredur.

    And here are more resources for anyone also interested in this topic.
    https://op111.net/53/

    Thread Starter simi_id

    (@simi_id)

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘wordpress 3.2.1 which is default theme ?’ is closed to new replies.