• Resolved SickSquirrel

    (@sicksquirrel)


    I created my first child theme. I copied the 11 or 12 lines from Codex to create style.css. I changed their theme name to mine.

    I then crated functions.php by pasting three or four lines from Codex.

    Uploaded all to ThemeName-child. Under Appearance )) Themes. Refreshed my Themes page but only my theme is there, no child. I can’t activate it.

    Now, my style.css only has the header. I assume I have to copy/paste in the file but I don’t see it outside the child directory. Now if that is right (after y’all help me find the file) do I paste in functions.php below my newly-created functions file?
    so, how do I pull it out of hiding???
    If

Viewing 15 replies - 1 through 15 (of 19 total)
  • Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    I assume you’re referring to http://codex.wordpress.org/Child_Themes#How_to_Create_a_Child_Theme ?

    If so, did you change Template: to match the parent theme’s directory, and Text Domain: to match the child theme’s directory?

    Thread Starter SickSquirrel

    (@sicksquirrel)

    Hm, no. I’ll try that tomorrow on my laptop. I can’t edit files right now. That should fix me? Thank you

    Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    That should fix it for you. Those two lines tell it how to find the parent theme and how to properly reference the child theme. If they aren’t customized for your situation, WordPress will be looking in the wrong place.

    The example at the link is for a child theme based off of Twenty Fifteen and stored in the /twenty-fifteen-child/ directory.

    If you were to make a child theme of the Sorbet theme and store it in the /my-awesome-theme/ directory, you would use:

    /*
     Theme Name:   Sorbet Child
     Theme URI:    http://example.com/my-awesome-theme/
     Description:  Sorbet Child Theme
     Author:       John Doe
     Author URI:   http://example.com
     Template:     sorbet
     Version:      1.0.0
     License:      GNU General Public License v2 or later
     License URI:  http://www.gnu.org/licenses/gpl-2.0.html
     Tags:         some, words, describing, it, separated, by, commas
     Text Domain:  my-awesome-theme
    */
    Thread Starter SickSquirrel

    (@sicksquirrel)

    I think I screwed up. First, WP says

    Broken Themes

    The following themes are installed but incomplete. Themes must have a stylesheet and a template.
    Name Description
    Zee News The parent theme is missing. Please install the “ZeeNews” parent theme.

    /*
     Template:     ZeeNews
     Text Domain:  zeenews-child
    */

    I see ZeeNews parent. Below it is ZeeNews-child in a separate directory. Perhaps the child should be under the parent directory?

    The problem is that this line must be:

    Template: zeenews

    caps matter

    And you must also have a name:

    Theme Name:  Zee News Child (or whatever you want)

    The Child theme should be in a separate directory – on the same level as all other themes – not inside the parent theme.

    Thread Starter SickSquirrel

    (@sicksquirrel)

    Parent theme is ZeeNews. I had 2 ZeeNews to activate. One was fine but child was missing I think. I tested the other — now EVERY page is white space.

    Can I rename the child to fix this until we can ge tmy child active???

    Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    Sure, just re-name the child theme’s folder, and that should force the default theme to activate.

    Parent theme is ZeeNews.

    You need to look at the name as it is on the directory for the theme – in this case, the one available on WordPress.org is zeenews.

    To double check, download a copy of the theme here:

    https://wordpress.org/themes/zeenews

    Unzip it and see what the name on the theme folder is.

    Or perhaps you changed it?

    Thread Starter SickSquirrel

    (@sicksquirrel)

    Hm, I show it as zeeNews and I changed it I think. I renamed it but can’t edit the style file until I find a better ftp app. Going to look now as I want to fix this. I’ll try all lowercase first and if not working, will try zeeN. Thank you

    Thread Starter SickSquirrel

    (@sicksquirrel)

    Well, neither works. Blank white pages unless I rename the child. Took four ftp programs until I found one that let me rename. I’m sure it’s just a capitalization is wrong somewhere… If the theme/template is zeeNews, I’m thinking of naming my child zeeNews-child. It is caps for now. If I could stay with one way of typing the name I would use just that. Maybe it will fix me? All named zeeNews? I’d change the styles file but want to be sure. If there is a file I should open to get the correct capitalization, please let me know.

    I’d suggest sticking with zeenews – and reinstalling the parent theme and starting over with your child theme.

    Also, what is in your child theme functions.php file?

    Thread Starter SickSquirrel

    (@sicksquirrel)

    Ok thanks, will try that tonight

    Functions.php child

    (<?php)
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    
    }
    Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    That shouldn’t be necessary, you can (probably) safely delete the child theme’s functions.php file (save a backup copy of it on your computer first).

    A child theme will include all files of the parent theme it does not have a replacement for, so building a functions.php file to do exactly the same is redundancy and probably the source of the problem.

    If you remove that file and your styles gets all messed up, add this just below the header section of your child theme’s stylesheet:

    @import url('../zeenews/style.css');

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘My Child Is Hiding’ is closed to new replies.