WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Yet another child theme problem - Can't activate child theme (31 posts)

  1. eclecticitguy
    Member
    Posted 2 years ago #

    I've been trying to implement a child theme on my WordPress site and have searched for a couple hours on Google to solve my problem. When I go into the WordPress admin under "Themes", I don't see my child theme listed. I see a lot of people having problems with case-sensitivity or incorrect directories being referenced in the "Template" section of the style.css header, but I've checked mine a hundred times. Does anyone have an idea why my theme isn't showing up to activate?

    Here is the directory layout:

    ./wordpress/wp-content/themes/rustic
    ./wordpress/wp-content/themes/rustic-child

    Here is the current style.css file under rustic-child:

    /*
    Theme Name: Rustic
    Theme URI: http://www.williambrentblack.com
    Description: Child Theme for Rustic
    Author: Wbb
    Author URI: http://www.williambrentblack.com/
    Template: rustic
    Version: 0.1
    */

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

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    What did you use to create the child's style.css file?

  3. eclecticitguy
    Member
    Posted 2 years ago #

    Very good question. I used TextWrangler on my Mac. I've seen problems with creating files using the regular TextEdit app adding a bunch of extra scripting to the files but I don't *think* TextWrangler is doing this. When I view the file with other readers, all of them appear to preview the text correctly (ie. I don't see any weird characters anywhere).

  4. Chip Bennett
    Theme Review Admin
    Posted 2 years ago #

    You can't name you Child Theme the same thing as your Parent Theme:

    Theme Name: Rustic
    Template: rustic

    These two values must be different. Try naming your Child Theme "Rustic Child Theme"

  5. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Unfortunately, I'm not a Mac user but I'm pretty sure that TextWrangler shouldn't cause any problems. It's listed on http://codex.wordpress.org/Glossary#Text_editor However, you might want to re-check the File/Save settings. My guess is that WP is having problems trying to read the style.css file.

  6. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    @Chip: Oh - well spotted! I completely missed that!

  7. eclecticitguy
    Member
    Posted 2 years ago #

    @Chip - That is good information and makes complete sense. I changed the name, however, the theme still isn't showing up. Just to clarify, the theme should appear as an option under "Manage Theme", right? I don't need to "install" it since it's already on my web server?

    Esmi - I'm thinking your idea is probably correct. Do you by any chance know which encoding format works for sure? Unicode? Western?

  8. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    the theme should appear as an option under "Manage Theme", right?

    Correct.

    FWIW, I use ANSI encoding/UNIX format when saving theme files on a PC.

  9. eclecticitguy
    Member
    Posted 2 years ago #

    Well, what the heck. I changed my file to Unicode-8/UNIX and it's still not working. Is it possible for my parent theme to somehow prevent the use of a child theme?

    I've checked all the permissions on the files. It's probably something really dumb.

  10. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Not all themes are particularly child-theme-friendly but I wouldn't have thought it could block a child them from being shown in the Theme list. What did you rename the child theme to?

  11. eclecticitguy
    Member
    Posted 2 years ago #

    Not all themes are particularly child-theme-friendly but I wouldn't have thought it could block a child them from being shown in the Theme list

    That's what I thought, but I wasn't sure.

    Here is how the file currently looks:

    /*
    Theme Name: Rustic-Child Theme
    Theme URI: http://www.williambrentblack.com
    Description: Child Theme for Rustic
    Author: Wbb
    Author URI: http://www.williambrentblack.com/
    Template: rustic
    Version: 0.1
    */

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

  12. Chip Bennett
    Theme Review Admin
    Posted 2 years ago #

    At the very least, it should be listed at the bottom of the page, under "Broken Themes". If you find it there, can you report the exact error message?

    Also, you need to report the Template name exactly as it appears in Theme Name of the Parent Theme's style.css file. So, try changing this:

    Theme Name: Rustic-Child Theme
    Template: rustic

    to this:

    Theme Name: Rustic-Child Theme
    Template: Rustic
  13. eclecticitguy
    Member
    Posted 2 years ago #

    Also, you need to report the Template name exactly as it appears in Theme Name of the Parent Theme's style.css file

    Tried that too but it's still no joy. I'm not seeing any "Broke Themes" section under the Manage Themes section.

    I normally wouldn't do this, but I just enabled directory access to my website temporarily. If you guys would't mind taking a look, maybe you can find something wrong that I'm not seeing?

    http://williambrentblack.com/wordpress/wp-content/themes/

  14. eclecticitguy
    Member
    Posted 2 years ago #

    Sorry, guys and gals. ;-)

  15. eclecticitguy
    Member
    Posted 2 years ago #

    @Chip - I confirmed that the parent style.css is named Rustic, which matches my child header name. Unfortunately, still no go.

    Theme Name: Rustic

  16. Chip Bennett
    Theme Review Admin
    Posted 2 years ago #

    Tried that too but it's still no joy. I'm not seeing any "Broke Themes" section under the Manage Themes section.

    You also have two Themes, "Rustic Child" and "Rustic Child Temp", in your Themes directory, both of which claim the same Theme name. You might want to remove one, or give one a different Theme Name: header.

  17. eclecticitguy
    Member
    Posted 2 years ago #

    You also have two Themes, "Rustic Child" and "Rustic Child Temp", in your Themes directory

    This was created after all of the other things I tried. I moved the existing "rustic child" into "rustic child temp" and tried to use the "Upload theme from .zip file" option in the WordPress admin section. Unfortunately, this didn't work either.

    I will remove the other folder now.

  18. eclecticitguy
    Member
    Posted 2 years ago #

    @Chip - I've tried both "Rustic" and "rustic" as the template tag but neither work. According to the WordPress Codex webpage, this template tag is supposed to be the directory name of the parent theme, unless I'm reading something incorrectly.

    Template. (required) directory name of parent theme, case-sensitive.

  19. eclecticitguy
    Member
    Posted 2 years ago #

    Just a couple of updates regarding this issue. To ensure I wasn't missing something big, I decided to create a child theme for the standard TwentyTen theme. During the first step, I simply created the twentyten-child folder, dragged the style.css from my rustic-child folder, and edited the file accordingly. Interestingly enough, my WordPress admin page now indicated that my Rustic-Child theme was broken due to a missing style.css file (which was true since I just moved it). I fixed the issue by moving the style.css back into the rustic-child folder and creating a new style.css for twentyten-child.

    My twentyten-child theme is now showing up as an option to activate. The rustic-child theme now longer indicates it's broken but it's still not an option to activate.

    I asked this question once to Esmi but is it possible for a parent theme to block the use of a child theme?? That's the only thing I can think of at this point.

  20. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Put it this way - I've never come across any such blocking and I'm not sure I can even get a theme to block a child if I tried. Does the rustic-child theme contain anything other than a style.css file?

  21. Chip Bennett
    Theme Review Admin
    Posted 2 years ago #

    I asked this question once to Esmi but is it possible for a parent theme to block the use of a child theme?? That's the only thing I can think of at this point.

    No; it's not possible.

  22. eclecticitguy
    Member
    Posted 2 years ago #

    Esmi - I completely believe you, I'm just stumped as to what else would be causing my child theme to simply not appear under the "manage theme" page, especially since I just successfully created a child theme for the TwentyTen theme.

    As for the rustic-child, the only file in the folder is the style.css. I compared the files back to back and the only thing different in the files is the word "rustic" verses "twentyten".

  23. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    I'm also somewhat mystified. Even if Rustic is not child-friendly, that would only affect your ability to over-wrote its functions in functions.php. You should still be able to over-rise the CSS. I can only guess that there's something very weird about the Rustic theme itself. Is it a free or a pay-for theme?

  24. eclecticitguy
    Member
    Posted 2 years ago #

    Dang it. I just fixed it. :-)

    Esmi - You were on the right track with the text encoding with TextWrangler. I realized that I created the twentyten-child style.css file directly from my web-server and was creating the style.css for the rustic-child on my mac. It appears that whatever encoding I was using (even though I modified it more than a few times to test) wasn't compatible with WordPress. After creating the style.css for the rustic-child on my web-server, it's now showing up as an option. Thank you for this insight!

    Chip - Your help with my naming conventions also corrected the issue. Thank you.

  25. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Excellent! Glad to hear that you solved the mystery. :-)

  26. zenny
    Member
    Posted 2 years ago #

    Just wanted to give a big shout out to you all for posting this issue and a solution. I have been driving myself crazy for a few days off and on trying to figure out why none of my child themes would show in Admin Manage Themes. I must have tried four different tutorials on creating a child theme with no joy. Please tell me again, what's the definition of crazy?

    Anyway, the good news is that after reading this post, I did discover that you can use TextWrangler for your CSS on a Mac and at the bottom of your document just change the encoding from "Classic Mac (CR)" to "Windows (CRLF)" save the file, and viola, it works!

    Alright, I'm a noob and I'm sure most of the WordPress development is done on Windows machines, but there must be a few of us web designers using Macs and it would be greatly appreciated if we weren't penalized. :-)

  27. thomas.andersen.lj
    Member
    Posted 2 years ago #

    I had the same problem: suddenly my child theme wasn't visible under Themes anymore. After reading this thread I realised that somewhere in between in changed the encoding in Notepad from ANSI to Unicode and what do you know, the child theme is back!

    Maybe one of the developers could add a comment about this in the codex tutorial?

  28. fitpiggy
    Member
    Posted 2 years ago #

    I'm a new wordpress user and this is my 1st child theme and I'm having the same problem. I'm using the twenty eleven theme. However changing the encoding isn't working for me. Unless I'm doing something wrong

    Working with with notepad++
    Using wordpress.org with bitnami on windows 7

    Here's my style sheet I have create in the child folder (using a tutorial):

    /*
    Theme Name: twentyelevenchild
    Theme URI: http://www.?.com
    Description: Child theme for Croad Accountants
    Author URI: http://fitpiggy.co.uk
    Author: fitpiggy
    Templete: twentyeleven
    Version: 1.3
    */

    I have tried saving the file as .css in Dreamweaver too but no joy...

    Can anyone help?

  29. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Please post a new topic.

  30. fitpiggy
    Member
    Posted 2 years ago #

    I have fixed it!

    I started from scratch and changed the encoding settings on a new file (wordpad++) rather than re saving the initial file I created and it worked.

    :-)

Topic Closed

This topic has been closed to new replies.

About this Topic