Support » Themes and Templates » Broken child-theme

  • Resolved Programul ESL


    I have made some changes to my parent theme, which is Twenty eleven, before I found out that I should have created a child-theme and alter that instead of the parent theme.
    So I decided to create a child theme, I followed all the steps, created a “twenyeleven-child” folder inside the themes folder, put a style.css in it and copied the following code in the .css file:

    [ Moderator note: please wrap code in backticks or use the code button. Do not use single quote. ]

     Theme Name:     Twenty eleven Child
     Theme URI:
     Description:    Twenty eleven Child Theme
     Author:         John Doe
     Author URI:
     Template:       twentyeleven
     Version:        1.0.0
    /* =Imports styles from the parent theme
    -------------------------------------------------------------- */
    @import url('../twentyeleven/style.css');
    /* =Theme customization starts here
    -------------------------------------------------------------- */

    But when I go to the Dashboard and try to activate it, it says “Broken Theme bla bla bla Template missing”. I checked the spelling of the template, it matches exactly the name of the parent-theme folder, “twentyeleven” that is, no caps, no spaces. The name of the style.css file is exactly like that, no caps no nothing.

    I read on the forum something about a “nested folders” problem, but the topic was closed before further explanations. So I need to add that my wordpress site is not installed directly in the “www” folder from the server,where my other HTML based site is, as I am still working on the wordpress site and don’t want to make it public yet.
    Instead, I created a folder named “wordpress”, inside the “www” folder, and I have installed there the whole wordpress, with themes and all. Could that be a problem?

    Thank you for your help.

Viewing 15 replies - 1 through 15 (of 24 total)
  • Is the parent theme installed? Is the file structure correct:


    Yes, the parent theme is installed and working properly. Yes, the file structure is correct as you described it.

    I have made some changes to my parent theme, which is Twenty eleven

    Have you corrected that by installing a fresh, original copy?

    I just did that. Installed a fresh original Twenty eleven theme, up to date. My child theme is still broken and off course, all may customisation is gone (i have saved the customised CSS in another file off course, it is not completly gone, just gone from the site).
    What can I do next?
    My site is if that helps in any way.

    no caps, no spaces

    Try something very simple like 20my11 as a name for your Child Theme and its folder to see whether that might help. Also, double check your style.css to get rid of any spaces at the ends of lines and no empty lines anywhere. And if you are not already using something as format-free as Text Pad (or Notepad in plain text), get a trustworthy file editor like Notepad++ if you do not already have one.

    (i have saved the customised CSS in another file off course, it is not completly gone, just gone from the site)

    Good move!

    I changed the name of the child-theme folder to 20my11. I have rechecked the code (allthough I have copy-pasted it from wordpress codex…), eliminated all the spaces from the end of the lines, no empty lines. No luck.
    The curious thing for me is that it’s saying “template missing”, as if it cannot find the parent-theme folder. But the folder is there, the parent theme is installed and working, and I’ve double checked to make sure that the name of the parent-theme folder and the name of the template from the child-theme’s .css match. I even copied the name of the folder, to make sure that I don’t spell it wrong or something. What am I doing wrong?

    Moderator Andrew Nevins


    Forum moderator

    This is your Child Theme style.css file right ?

    Why does it look like that, all on one line?

    Exactly. Try this, and be sure your folder keeps this same name:

    * Theme Name: 20my11
    * Theme URI:
    * Description: Child Theme for Twenty Eleven
    * Author: me
    * Author URI:
    * Template: twentyeleven
    * Version: 0.1.0
    @import url("../twentyeleven/style.css");
    * Theme customization begins below this line */

    @andrew: Yes, that’s the css. I have no ideea why it looks like that. In my editor (TopStyle that is) it did’t look like that, it looked all tidy and organised like the code above.
    @leejoseph: I copied the code taht you gave me, and pasted it in a file calles style.css and uploaded it in the folder “20my11”, that is , toghether with the folder “twentyeleven”, in the “themes” folder.
    Then, I went to the dashboard, to appearance -> themes and clicked the refresh button. This is the result: (click on the image to enlarge, I did’t know how to add an image here on the forum).

    Moderator Andrew Nevins


    Forum moderator

    Try deactivating all plugins and then see if your Child Theme style.css looks like that.

    Yes, I would guess you have some kind of minification or cache plugin running.

    I have deactivated all the plungins from the site. The css still looks the same to me. You can check it at the link.
    I’ve deleted the cache from my browser (chrome) and hit the refresh button, and the css still looks the same.
    And the theme is still broken.
    By the way, I am so gratefull that you both took the time to help me and that you have the patience to keep looking into the problem. I hope we will solve the mistery in the end and get my a secure child theme that I can alter without risks. So what could I do next?

    Moderator Andrew Nevins


    Forum moderator

    Your Child Theme style.css file looks like it has an asterisk after the ‘template’ name, is this something you’ve added?

    No, I haven’t added a single thing.
    I think that is the asterisk that comes in front of every row, like in the code given by leejosepho. but because the css on the site has no rows, the asterisks come inbetween code.
    I am not an expert but I think that the /* */ signs are for commenting out a chunk of code. Should I remove the comment signs?

    No, that code is okay, but you have something somewhere doing a minification of some kind that is putting everything out as a string.

Viewing 15 replies - 1 through 15 (of 24 total)
  • The topic ‘Broken child-theme’ is closed to new replies.