In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article focuses on "can the dashicons.min.css file of WordPress be removed". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "can the dashicons.min.css files of WordPress be removed?"
Similar to code refactoring, don't easily remove code that looks "useless". Easily changing things that you are not familiar with may introduce more problems and thus become more troublesome. I walked through a big pit a few days ago and found that the "useless" I saw in front of me was not really useless.
I tested the loading speed of the site with PageSpeed Insights a few days ago. According to the test results, there is no room for optimization except to remove the useless dashicons.min.css.
In order to get a higher score and faster loading speed, users decided to remove this "useless" css file. Unexpectedly, grep could not find the corresponding link tag directly in the file. After Google search, the following code was found and placed in the functions.php file of the current topic:
/ / remove dashicons in frontend to non-admin function wpdocs_dequeue_dashicon () {if (current_user_can ('update_core')) {return;} wp_deregister_style (' dashicons');} add_action ('wp_enqueue_scripts',' wpdocs_dequeue_dashicon')
After the change, test again, the dashicons.min.css is no longer loaded, perfect!
Looking at the website page today, I found that the "back to the top" button in the lower right corner is missing, replaced by the unstyled "scroll up" text in the lower left corner. Where is the floating button set by the "to top" plug-in?
Let's start with various checks: is there a problem with the autoptimize plug-in? Is it incompatible with the "to top" plug-in? Is it the cache problem? After logging in to the background, the button appears again, why? Wait, find all kinds of problems.
Finally, it is decided to locate the problem by reviewing the changes of the elements before and after landing. What you can see is that the html elements are consistent, but some css attributes are missing. Add the missing css attribute to it, which is barely available, and the shape is awkward. If you take a closer look, the css settings for the "dashicons" category do not exist, so it is no wonder that the icon is wrong. Wait, wait. Css's "dashicons" class, why does this look familiar? Recall carefully that dashicons.min.css was removed a few days ago. Is that the problem?!
So comment out the removal dashicons.min.css code added a few days ago, test it again, and the familiar "back to the top" icon is back!
Referenc
How to remove dashicons.min.css from frontend?
At this point, I believe you have a deeper understanding of "can the dashicons.min.css files of WordPress be removed?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.