Viewing 7 replies - 1 through 7 (of 7 total)
  • What do you have in the style.css file? This shows up with strange characters in the @import line:

    @import url(‘../moesia/style.css’);

    BTW, using @import is no longer considered best practice for a child theme – see:

    http://codex.ww.wp.xz.cn/Child_Themes

    Thread Starter seancli

    (@seancli)

    Ah those are (‘) instead of (“). Both got me the same results but to be proper I’ll change it back

    Also I read about @import not being the best anymore, I just did it because it seemed simpler. I’ll start reading about the other way more in depth. Thanks!

    Thread Starter seancli

    (@seancli)

    Updated below

    Thread Starter seancli

    (@seancli)

    So I removed the @import line from style.css, created functions.php in the same folder, and entered 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' );
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array('parent-style')
        );
    }
    
    ?>

    But now I have a syntax error.

    Try this in the functions.php file:

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

    Don’t use a closing PHP tag – it’s no longer considered best practice.

    Thread Starter seancli

    (@seancli)

    Worked! Thanks so much!!

    Oh cool :)! Glad to hear it and you’re welcome!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Child Theme Help’ is closed to new replies.