• I am trying to figure out how to properly enqueue a child theme stylesheet and I cannot figure it out. I have this in my child theme functions.php:

    <?php
    
    //Get UIC Child Theme Styles
    function uic_styles() {
    
    	wp_enqueue_style( 'uic-styles', get_stylesheet_directory_uri() . '/library/css/style.css' );
    }
    add_action( 'wp_enqueue_scripts', 'uic_styles' );
    
    ?>

    But when I look at the page source for my site, the child theme styles are loading first and the parent styles are loading second. This means that the parent styles are overriding the child styles. How do I fix this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • lisa

    (@contentiskey)

    can you share the code in your style.css file for child theme only?

    Thread Starter mcography

    (@mcography)

    I am using SASS, so I have a couple of stylesheets. In the root of my child theme, I have style.css which has this:

    /*!
     Theme Name:   UIC
     Theme URI:    http://slamagency.com
     Description:  Child theme of the SLAM! theme for UIC.
     Author:       Megan Carroll
     Template:     slam-theme_v1
     Version:      1.0.0
     Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
    */
    /* =Theme customization starts here
    -------------------------------------------------------------- */

    In root > library > css I have style.css which has all of my child theme styles.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Why are my child styles loading before my parent styles?’ is closed to new replies.