WordPress websites divide the image to enrich the visualization of the entire presentation, and often use various icon sets such as Font Awesome, Elusive Icons, Genericons, etc., but additional cloud-loaded icon files are required, and even plug-ins are used for convenience. Using icons, coupled with many plug-ins, will often load their own icon groups, which often becomes one of the main sources of slowing down the speed of the website. If you can make good use of the built-in Dashicons icon group, it will help improve your website. overall speed.

Basic introduction to Dashicons

Dashicons is a built-in icon group in the core of Wordpress. When you enter the background management interface, you will see various icons in the function bar. However, when browsing in the foreground, if you are an ordinary user who is not logged in, Dashicons will not be automatically loaded. After entering, the icon will not be displayed. At this time, you can use the code snippet (Code Snippet) to load Dashicons to make the website more visually rich.

The following describes how to enable Dashicons in the frontend. Once the frontend is browsed and loaded, you can directly use Dashicons to enrich the website's visuals when writing web pages. Please refer to the official website of Dashicons for usage methods.

Related Post: Dashicons official website

Loading practices for Dashicons

Method XNUMX: Modify the theme of the scene

Modify the functions.php file of the theme theme, in

add_action( 'wp_enqueue_scripts', 'load_dashicons_front_end' );
function load_dashicons_front_end() {
wp_enqueue_style( 'dashicons' );
}

Method XNUMX: Code management plug-in

Use code snippets (Code Snippet) to manage plug-ins, such as: Code Snippets,WPCodeBoxWait for the plug-in, and choose to add the PHP-type code snippet. Usually, the code snippet management plug-in will be added automatically.

<?php
add_action( 'wp_enqueue_scripts', 'load_dashicons_front_end' );
function load_dashicons_front_end() {
wp_enqueue_style( 'dashicons' );
}

In addition to using code snippets, of course alsoMenu Icons by ThemeIsleWaiting for the plug-in can help load and manage the icon group, but even having to install another plug-in can easily cause the website to slow down or have minor problems when browsing. The graph shows that there is a problem.

Recommended reading for the latest articles

About Ailvzhi two or three things

  • Love Travel is a blog jointly run by Anya and Wendy. It mainly shares travel-related information and experiences. It opened a station in Piggy State in May 2008. It was a stand-alone station in 5. In 2013, a member of Hamburger was added. , To become a travel partner together.
  • Ailvzhi opened on FacebookWendy BurgerFan page, operationAiluzhi Department Store,Love Living New Hotel,Just love Thailandand other clubs, you can also follow theInstagram, And occasionally release short videos in Love TravelYoutube.
Travel enthusiasts can visitFacebook fan pageInteract with us, or leave a message at the bottom of each article.

Contact us

Name
Email
Message(s)
A letter has been successfully sent to contact Love Travel!
Failed to send the letter, please recheck whether the information in the fields is complete!

website build

The Love Travel Blog website is built using and recommends the following cloud hosting platforms, themes and plug-ins.

Use flexible and user-friendly cloud hosting services
Highly customizable, fast-loading website theme
Powerful, lightweight and fast code management plug-in