I created a child theme of twentytwelve using the following in style.css:

/*
Theme Name: WAMSA
Template: twentytwelve
version: 0.1
*/

@import url("../twentytwelve/style.css");

In Appearance > Theme, the template is listed with error:

The following themes are installed but incomplete. Themes must have a
stylesheet and a template.

Description: Template is missing.

The codex says only a style.css file is required, which is what I have.

I uninstalled and reinstalled TwentyTwelve theme, without a change.

Why is my child theme not being recognised?

Update.

Here is what I am doing to generate this problem.

  1. Twenty Twelve theme is installed.
  2. I create a folder on my local computer, and create a style sheet style.css inside this folder.
  3. I place the code above into style.css, then I FTP the folder I created up into /wp-content/themes.
  4. When I go to Appearance > Themes, I receive the errors above.

Update2

If I upload this child theme to a different WordPress installation, it does not become broken.

3 Answers
3

I found the problem.

I went to edit the stylesheet in WordPress’s editor, and saw that the stylesheet’s code had been moved onto 1 line. This meant the top comment section was also on one line, and the Template: twentytwelve was not distinct.

Adding line breaks resolved the problem.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *