• I am very new to WordPress. The limited knowledge that I have comes from working with WordPress, hitting a roadblock, researching, piecing together the answer and moving forward…..probably should pick up a book or two…

    I have a plugin and a theme that do not play well together. I really like both and want to use both. -Graphene + Spider FAQ-
    So…..I have figured out the lines in the plugin’s style.css that I can mark !important and then everything looks great….but

    If I make the changes there, and there is an update to the plugin, I will lose my changes right?

    So, I did some research on Child Themes….

    I created a child theme and when I add the lines to it from the plugin, everything looks great….but

    If I add these lines to the Child theme, the changes are for all pages/posts, not just when this particular plug in is being used. Which at the moment isn’t causing any issues, but I don’t think this is the best way to go about this issue.

    So, is there a code that I can put in the Child theme that states something along the lines of…..when plugin “x” is used, apply the following code? An “if” : “then” statement?

    The plug in is an FAQ plugin…so I don’t have a dedicated page/template to FAQ’s….I will be putting them on various pages.

    What are other options? (Keeping in mind..I’m a WordPress newbie)

Viewing 1 replies (of 1 total)
  • There is always a way.

    You are correct about updating the plugin and lossing any changes to it.

    You can do a function check on a function that the FAQ plugin uses. If the the function exists then the you can apply a CSS filter. This would be a last case senerio in my opinion.

    Have you tried defining more specific CSS elements?

    Example:

    <div id="menu">
       <ul>
          <li class="item">Item</li>
       </ul>
    </div>

    Style Example:

    #menu li {color: #666666}
    
    /*More specific hook trumps above */
    #menu li.item { color: #FFFFFF; }

    By applying a more specific hook for styles in your child theme you should be able to trump any styles a plugin adds and still have the same style even if the plugin is NOT installed

Viewing 1 replies (of 1 total)
  • The topic ‘Modifying Plugin in Child Theme’ is closed to new replies.