wordpress: style of child theme not being applied

open the "view code" option on your browser (control + u on firefox) and make sure your child.css is the last css file o the list.

if there is another .css file below your child.css it may be overwriting it.

in my case the styles.min.css (the minified version of my theme) was loading after the child and it overwrote it, so what I did was:

  • went to the place where this minified file was loaded, in my case

wp-content/themes/sydney/functions.php

 

  • comment this line and add it to the functions.php inside my child-theme on top of the child-css
    • wp-content/themes/sydney-child/functions.php
    • add:
wp_enqueue_style( 'sydney-style-min', get_template_directory_uri() . '/css/styles.min.css', '', '20221019' );

 

Leave a Reply

Your email address will not be published. Required fields are marked *