• I have a child theme set up and the site has the eshop plugin installed. But now I need to change the look of eshop. I know I can do this by going to the Plugin editor to edit the plugin css file but then I overwrite the plugin files. So when I get a plugin update I will lose the changes. Is there such a thing as a “child” for plugins. If so how do I implament it?

    If not what is the solution to not losing your changes everytime you update the plugin?

Viewing 4 replies - 1 through 4 (of 4 total)
  • You can still make changes to your child theme which will affect the plugins. It’s a little different depending on whether you are wanting to adjust CSS or PHP though.

    If it’s CSS, you can add the styles for any plugins to your stylesheet and they will get called on the same page. I think a child theme gets called last in the sequence… but if you notice your changes aren’t sticking… you might want to use the !important declaration just to make sure.

    If it’s PHP you’re wanting to adjust… you’ll need to know if the plugin uses any custom hooks or filters.. and “hook” into them accordingly via your child theme functions.php file.

    Thread Starter petriknz

    (@petriknz)

    I did try putting CSS from the plugin directly in to the Child CSS file but it didn’t appear to do anything. I’ll have another go just in case I was adjusting something other then what I thought I was working on.

    Changing CSS will depend on where the rules are in the file, and the order that file is loaded compared to the other files. If your stylesheet is loaded before the plugins stylesheet, then the plugins stylesheet will over-write any changes that you try to make.

    The most common way around this is to add an !important declaration to the rule. As an examle:

    p.my_class_name {
        color: #FF0000 !important;
    }

    Also be sure to refresh your browser cache and empty any caching plugins you might be using when working with CSS and viewing changes.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Child theme and Plugins’ is closed to new replies.