• Good morning!

    I’ve finally managed to set up a child theme on my site, and everything works as before, as far as I can see. However, I’d like to double-check something with you guys before I relax about it entirely.

    On the WordPress Child Themes help page it says “If your theme has more than one .css file (eg. ie.css, style.css, main.css) then you will have to make sure to maintain all of the Parent Theme dependencies.”

    So, firstly, could anyone explain what that means in simpler terms, and secondly, do I have to do something else with my child theme, even though it seems to be working correctly?

    If I click on the ‘editor’ tab within the Twenty-Twelve theme itself, I can see under styles that it has ‘style.css,’ ‘editor-style-rtl.css,’ ‘editor-style.css,’ and ‘rtl.css.’ Whereas in my Hostgator Control Panel I can only see under wp-content one directory for CSS, with just one file in it titled ie.css.

    So, my main query is, do I have to “maintain all of the Parent Theme dependencies,” whatever that means, or have I done enough by just adding the below (obviously with the changes)…

    /*
     Theme Name:   Twenty Fifteen Child
     Theme URI:    https://example.com/twenty-fifteen-child/
     Description:  Twenty Fifteen Child Theme
     Author:       John Doe
     Author URI:   https://example.com
     Template:     twentyfifteen
     Version:      1.0.0
     License:      GNU General Public License v2 or later
     License URI:  https://www.gnu.org/licenses/gpl-2.0.html
     Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
     Text Domain:  twenty-fifteen-child
    */
    
    and this...

    <?php
    add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
    function theme_enqueue_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );

    }
    ?>

    Many thanks for your help,

    Stuart

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter sbgolledge

    (@sbgolledge)

    Anyone at all?
    I’d be extremely grateful!

    Hi, @sbgolledge.

    On the WordPress Child Themes help page it says “If your theme has more than one .css file (eg. ie.css, style.css, main.css) then you will have to make sure to maintain all of the Parent Theme dependencies.”

    So, firstly, could anyone explain what that means in simpler terms, and secondly, do I have to do something else with my child theme, even though it seems to be working correctly?

    It means that if the parent theme has other .css files that the child theme will need to use, then you’ll need to add another wp_enqueue_style statement to your theme_enqueue_styles function for each of those extra files.

    Thread Starter sbgolledge

    (@sbgolledge)

    Hey, many thanks, girlieworks, I was losing heart there!
    Would I be correct in thinking, then, that if I can see no differences to my site when using my basic child theme, then all is well and I don’t need to enqueue any other of the css files?
    Really appreciated your response, many thanks again,
    Stuart

    An easy way to tell if are bringing in all of the CSS files is to first activate the parent theme, then do a view source. Look for lines which have .css; you are particularly looking for the ones which are in the /themes/twentytwelve folder. You should see two for the Twenty Twelve theme: style.css & ie.css.

    Then activate your child theme and do the same thing, except now you’re looking for the files in your /themes/twentytwelve-child folder. You should see one additional CSS file, the style.css file for your child theme.

    Thread Starter sbgolledge

    (@sbgolledge)

    Many thanks, CrouchingBruin, I’m always so amazed when someone shares their knowledge in this way!

    You’ll have to forgive my lack of understanding, but would I be correct in thinking that I’m looking for this information only in the http links in the ‘stylesheet’ area of the ‘view source’? If so, I can see that everything, including an ie.css in green, has migrated across to my fixed front page.

    ='parent-style-css'  href='https://karma-free-life.com/wp-content/themes/twentytwelve/style.css?ver=4.5.2' type='text/css' media='all' />
    <link rel='stylesheet' id='twentytwelve-style-css'  href='https://karma-free-life.com/wp-content/themes/twentytwelve-child/style.css?ver=4.5.2' type='text/css' media='all' />
    <!--[if lt IE 9]>
    <link rel='stylesheet' id='twentytwelve-ie-css'  href='https://karma-free-life.com/wp-content/themes/twentytwelve/css/ie.css?ver=20121010' type='text/css' media='all' />

    Would I need to check the other pages, say, my posts for example, or is this enough evidence that I can leave well alone for now?

    Oh, and do I have to worry about not being able to see ‘editor-style-rtl.css,’ ‘editor-style.css,’ and ‘rtl.css,’ which are files that I can view when clicking on the twentytwelve ‘editor’ in the WP Dashboard itself?

    Many, many, thanks again,

    Stuart

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Twenty Twelve Child Theme’ is closed to new replies.