• This is duplicate post of another wp user.

    https://www.ads-software.com/support/topic/overriding-all-other-stylesheets?replies=4

    But I don’t know how to do this what they said.

    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.

    Can anyone give me example of above ways?

Viewing 3 replies - 1 through 3 (of 3 total)
  • For #1, that means editing the PHP code of each plugin and commenting out the call to wp_enqueue_styles. This is definitely not a solution for beginners to try.

    For #2, you would edit your theme’s header.php file and insert a link to your CSS file after the call to wp_head() but before the closing /head line. For this modification, you should not modify the theme’s header.php file directly, but create a child theme, copy the parent theme’s header.php files over to your child theme, and make the change to that file. Again, not something for a beginner to try first.

    Before you try something that extreme, you should explore some other possibilities. There are CSS plugins that will do pretty much the same thing. Lazyest Stylesheet will add your custom CSS just before the closing /head tag, for example. You should be able to use that to override any CSS (except for those sneaky plugins that put their CSS files into the footer). Or if you want to include an external CSS file, you can use a plugin like Header and Footer to insert a link to your external CSS file in the head section.

    Are you having problems with the CSS for a particular site? If you post a link to your site, I can take a look and see how you can override the problem CSS.

    okay…removed!

    @topfuelman: As per the Forum Welcome, please post your own topic. Your question has nothing to do with the original poster’s

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