Support » Everything else WordPress » How do you override styles that have been set by your widgets?

  • I’ve noticed that two of the widgets I am currently using, Lastfm records ( and WP Random Quotes ( add their own styles to the head of each page that they show up on.

    I don’t like the default styles and want to change them, but I can’t work out how to change my styles.css in such a way to override what is in the page itself.

    I’m probably just showing my css ignorance, but whatever changes I make to (for example) the border, which is defined in the head get ignored. If I define something different (eg display: none) that works.

    I’ve tried !important, but I’m either doing it wrong, or don’t correctly understand what it is for?

    Any ideas?

    If it helps, look at – the Lastfm records are at the bottom. I am trying to style them like the flickr photos above them.


    Shayne in .au

Viewing 6 replies - 1 through 6 (of 6 total)
  • Jeremy Clark



    If the plugin doesn’t have a separate stylesheet in it’s plugin directory then you’ll have to edit the plugin itself. I personally hate plugins that do that.

    I was afraid you were going to say that.

    Can I get a second opinion (and will it make any difference?)

    Yes, I “second” Jeremy 🙂

    Thanks Jeremy, moshu

    I was hoping for a css-only solution, but knowing what was going on a bit better has helped me find an easy-ish solution.

    In both of my problem plugins, the css styling is in a function, which is then called elsewhere. Rather than mess about with the styles, I have simply commented out the call to the style function.

    Eg in there is a call (line 1042 in the version I have)
    add_action('wp_head', 'lastfmrecords_stylesheet');

    Commenting this out means the <head> no longer has the offending styles, but the classes etc still appear in the html.

    Not ideal, but it works. Issue resolved (though now I have to remember to makes the changes again if I download an update!).


    I am the author of the WP Random Quotes. The styles added by the plugin are nearly all margin and padding settings so that the quotes appear indented on the sidebar or page. There is ONE font change – to make the author’s name boldfaced and right-aligned.

    That’s all well and good, your style choices seem perfectly reasonable, but what if they don’t fit with the rest of my theme and I want to change them a bit.

    I can’t.

    Please don’t take this the wrong way. Your plugin is great and I didn’t pick on yours especially, I just noticed the problem (as I see it) on it.

    Also note that the author of the plugin I mentioned has added an option to include the css or not. In other words, he (like you) has ideas on what makes for good mark up on his plugin, but now gives me the option to turn it off and to make my own decisions.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How do you override styles that have been set by your widgets?’ is closed to new replies.