enqueue child style LAST?
-
I use a number of plugins and I’m getting fed up with them forcing styles via a multitude of !important properties, spread across numerous files that override my child styles.
My child style.css is loading before the offending stylesheets, so using my own !importants is pointless.
I read somewhere that !important in the page head has priority over all stylesheets, but I’m not keen on doing that. I want to keep everything in style.css.
For now I must dequeue each offending file, copy its contents into a new stylesheet file in my child theme and enqueue that. Sure, it works, but I keep running into new files that override my work. Also, the likelihood that a theme or plugin dev will make changes in an update that will break my styles is increased doing it this way. Devs putting that !important crap everywhere is so aggravating.
I could find no solutions to this via much Googling. I tried some array schemes and enqueue loops; no joy. I looked through the WP enqueue docs as well. Registering and deregistering are not helping, and obviously I only want to modify certain css, not mass remove the originals. I’m sure this must be easy, and I must be doing something stupid simple wrong, but I’m stumped.
Does anyone have a functions snippet that actually forces the child style.css to load LAST, after parent, after plugins, after everything?
- The topic ‘enqueue child style LAST?’ is closed to new replies.