Support » Themes and Templates » Child Theme Not Working

  • I’ve got tired of always having to redo my whole site every time I update WP so I decided to make a child theme. I spent the morning checking on tutorials, and most of what I’ve found basically says to create a folder in “wp-content/themes” and name it what you want, then add a stylesheet and make sure the “head” section of the stylesheet has the following info…

    /*
    Theme Name: MyTheme
    Theme URI: http://wordpress.org/
    Description: Child Theme for Twenty Ten
    Author: John Smith
    Author URI: http://mysite.net/
    Template: twentyten
    Version: 0.1
    */

    @import url(“../MyTheme/style.css”);

    Well, I did all this, and all I get on the Theme page of my dashboard is “Broken Themes – The following themes are installed but incomplete. Themes must have a stylesheet and a template.”

    If anyone could help me figure this out I would sure appreciate it. Thank you.

Viewing 11 replies - 1 through 11 (of 11 total)
  • not:
    @import url("../MyTheme/style.css");

    but:
    @import url("../twentyten/style.css");

    this is to pull the parent theme’s styles into your child theme; before thay get overwritten by your changes in style.css of your child theme.

    Thread Starter dcloud

    (@dcloud)

    That doesn’t make any sense, since the whole point of making a child theme is so that you can keep your changes (in the stylesheet of the child) when you update WP.

    I tried what you said and now nothing appears on the Theme page but Twenty Ten.

    I tried what you said and now nothing appears on the Theme page but Twenty Ten.

    my mistake – it actually does work without the @import line;
    or with a different import style.

    the only requirement is that the child theme has a style.css with this kind of code at the start:

    /*
    Theme Name: MyTheme
    Theme URI: http://wordpress.org/
    Description: Child Theme for Twenty Ten
    Author: John Smith
    Author URI: http://mysite.net/
    Template: twentyten
    Version: 0.1
    */

    http://codex.wordpress.org/Child_Themes

    Thread Starter dcloud

    (@dcloud)

    That’s exactly what I did. It’s in my first post. The stylesheet for my child theme is in the child theme folder I created.

    is the folder structure and location of your child theme’s style.css:

    /wp-content/themes/mytheme/style.css

    Thread Starter dcloud

    (@dcloud)

    Yep, it’s … /wp-content/themes/2011/style.css

    I named it 2011, but I used generic info in the examples above.

    Thread Starter dcloud

    (@dcloud)

    Ok, this is really interesting. I changed the name from 2011 to twenty-eleven and changed it in the stylesheet and now it appears on the Theme page. I guess WP can’t handle themes with numerical names.

    Now to figure out how to make the screenshot and if I need to have any more files inside the child folder (like functions, index, etc.).

    As I said in the comments at op111.net — http://op111.net/53/ — it seems there is a bug with theme names that have only numbers:

    http://core.trac.wordpress.org/ticket/15306

    Cheers!

    Thread Starter dcloud

    (@dcloud)

    demetri, alchymyth, thanks for your help. On to another question: now that I have the theme appearing on the Themes page, what other files (besides the style.css) should I have in there?

    Say I have changes I made in loop.php and functions.php, and a couple other files – how would I include these in the child theme folder? Just as they are or do I have to make some changes to them?

    Thanks.

    One little detail to remember; activate your child theme.

    not:
    @import url(“../MyTheme/style.css”);

    but:
    @import url(“../twentyten/style.css”);

    this is to pull the parent themes styles into your child theme; before thay get overwritten by your changes in style.css of your child theme.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Child Theme Not Working’ is closed to new replies.