• Resolved Sprutt

    (@sprutt)


    Hi,

    I’m locally developing a simple child theme and I got the very basics setup and working, but when I add style changes to the childs style.css they do not override the parent. Throught the browser inspector I can see that they are there, but the parents css is being prioritized it seems.

    Is there a way except adding !important to every single line to have it just use the child css when present?

    Thanks in advance!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Sprutt

    (@sprutt)

    I will have now have to eat my hat and admit I made a stupid mistake, which was to leave a functions.php file in the parent theme, incorrectly assuming the one i created in the child theme would append it. After moving that one to the child theme and adding the child theme enqueues to the end of it instead it works as expected.

    Theme Author Qode

    (@qodeinteractive)

    Hello,

    We are glad to hear that you’ve managed to resolve this in the meantime, and thank you for your feedback.

    Best,
    Qode

    Thread Starter Sprutt

    (@sprutt)

    Hello again,

    It just struck me that if I update the parent theme in the future it will get a new functions.php in it, correct? Of course it’s not a huge deal to just remove it, but it got me wondering if this might not be the best practice for using a child theme. Is this how it usually is done with this theme?

    Theme Author Qode

    (@qodeinteractive)

    Hi,

    To create a Child theme where you can save theme files so they are not overridden when the theme is updated, please follow instruction from this article.

    Best,
    Qode

    Thread Starter Sprutt

    (@sprutt)

    Thank you!

    I have now followed the guide and got it working while still leaving the functions.php in the parent, but it then starts prioritizing the parents CSS again. And any changes I make to the child themes copies of PHP files are not considered, while if I make the same changes directly in the parents files it works as expected, for example modifying the content of the header.

    Is this theme not set up to have child themes, or am I missing something perhaps?

    Theme Author Qode

    (@qodeinteractive)

    Hi,

    The Child theme can be created as explained in the article. We recommend checking the “How to Add Template Files to a Child Theme” section of the article where it’s explained in more detail how files can be overridden.
    You can let us know what changes are you trying to make and in what file so we can give you more precise answer.

    Best,
    Qode

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.