I am having some trouble getting my child theme to work perfectly. I have successfully created a child theme based on the Flexia theme. I have made child themes before but not come across this issue before. I have also had a look at the similar questions about child themes not overriding the parent theme, but I'm afraid I'm still stuck.

I think (although I am not sure the issue may be that the Flexia theme has multiple css-files, but I'm not sure how to address that in the functions.php.

This is the CSS from my child theme: http://stvl.no/wp-content/themes/flexia-child/style.css

This is the CSS that is overriding my child theme: http://stvl.no/wp-content/themes/flexia/framework/assets/site/css/style.css

However, this is the CSS that I have linked to in the functions file: http://stvl.no/wp-content/themes/flexia/style.css

This is what my functions.php looks like:


So my issue is that while the child theme CSS is working in come instances, in others it is only pulling from the parent CSS, but only the one under framework/assets/site/css/style.cc , as the parent root CSS is empty.

The site is currently in maintenance mode but let me know if you need any more info at all. Any tips or ideas would be much appreciated, been staring at this for way to long now.

| improve this question | | | | |
  • Make sure your CSS rules are specific enough to overwrite the parent theme's: developer.mozilla.org/en-US/docs/Web/CSS/Specificity – Jacob Peattie Apr 9 '18 at 13:16
  • I could be wrong, but I believe the parent style is automatically pulled if there's a style.css in the theme folder. As a result, I don't think it needs to be enqueued by functions.php. Does it work correctly if you only enqueue the child style? My thought is that you're enqueuing parent style, then child style, then the theme is grabbing parent again from the default location. You may want to set a high priority (later execution) on the enqueue to make sure it executes after the default, if applicable. – MarkPraschan Apr 9 '18 at 13:42
  • Please paste your code in the editor instead of embedding images because the images can disappear and make the question useless for other visitors. Thanks. – Nathan Johnson Apr 9 '18 at 14:25

there a few ways you can resolve this issue,

  • find the handle of the parent css you want to override/remove and use wp_dequeue_style($parent_css) to remove it altogether.
  • find the handle of the parent css you want to override and include it as a dependency in your child-css like you did for the $parent_style
| improve this answer | | | | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.