• Many plugins add their own stylesheet.

    How can I make my default theme stylesheet override all other stylesheets?

Viewing 3 replies - 1 through 3 (of 3 total)
  • There’s a couple different things that you could do, I would do #1:

    1. Modify each plugin to NOT add styles. Styles are usually added via the wp_enqueue_styles() function or by adding an action to the wp_head hook. You can comment out the appropriate lines.

    2. In your themes header.php file make sure that your style sheet is linked AFTER the wp-head function. This way all of the custom styles from the plugins will still be printed, but you styleshhet will “have the last word” and you can make modifications but redefining the style in your themes style.css file.

    Hope this helps,
    -Mike

    Thread Starter subirghosh

    (@subirghosh)

    Hi Mike,

    Thanks for the tip.

    I wouldn’t go for the first option because working around with a number of files all the time (especially keeping upgrades in mind.) It is difficult to keep a mental note of things.

    The second of course did not cross my mind at all. But it works.

    Thanks a lot.

    Subir

    No problem! glad I could help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Overriding all other stylesheets’ is closed to new replies.