Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #232972

    Hello, I have a child theme set with Eunoia. However, styles.css file is loading before layout.css and others so I need to make my styles !important to override the next styles.

    Is there a way to modify the functions.php file in the child theme to change the load order?

    #233757

    Anyone? If not, is there any idea when the theme will be updated to incorporate this new load order? I don’t want to modity the default functions.php file and then need to remember the change when I update the theme…

    #234145

    Hi!

    You can duplicate the default header.php file into your child theme and then delete this line:

    
    <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
    

    and replace:

    
    <link rel="stylesheet" href="<?php echo get_bloginfo('template_url'); ?>/js/prettyPhoto/css/prettyPhoto.css" type="text/css" media="screen"/>
    

    with

    
    <link rel="stylesheet" href="<?php echo get_bloginfo('template_url'); ?>/js/prettyPhoto/css/prettyPhoto.css" type="text/css" media="screen"/>
    <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
    

    By going this way the parent theme will load the child theme header.php and you won’t break the stylesheet order when you update the parent theme.

    Best regards,
    Peter

    #234835

    Beautiful! I can’t believe I didn’t think of it. Must have been having a “moment”

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘CSS Load order with child theme’ is closed to new replies.