S
S
Sergey Dydaevskiy2016-04-29 19:28:27
css
Sergey Dydaevskiy, 2016-04-29 19:28:27

How to disable a specific stylesheet when going to the WordPress admin panel?

At the moment, I'm finishing up a site that was partially transferred from CMS Type3, since I had to transfer several blocks from the old version of the site and transferred the styles, on the frontend everything is displayed as it should (almost as it should, but that's another story), but when entering The WordPress admin panel has a minor annoyance (and it's insanely annoying) that the "Bootstrapv3.3.5.css" stylesheet creates.
How to make style file "Bootstrapv3.3.5.css" not active in admin panel?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Kudryavtsev, 2016-04-29
@kumaxim

Go to the folder wp-contents/plugins, create a subfolder there disable-bootstrap. Copy any plugin skeleton into it, at least this one .
In the wordpress-plugin-boilerplate.php file, we define another arbitrary method, let it be public function disable_css(), in the body of which we use the wp_dequeue_style function . As a parameter, you need to pass the id of the link tag that breaks everything for you. Then, in the constructor, make another call to the add_action function , for example, here is add_action('add_action', [$this, 'disable_css'])
Profit!
Note : my method will only work if you originally included the script through the wp_enqueue_style function. If you or someone before you just wrote a link tag in a .php file, then only a full-text search in all WP files will help you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question