How to browse and enable Dashicons built-in icon group in the frontend of WordPress?

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 Reading ▶️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.

Is this article helpful to you?

If you like the article...

Welcome to track our dynamics!

Sorry the article didn't help you!

please give us suggestions

Follow Us On Instagram

Recommended reading for the latest articles

About Ailvzhi two or three things

Selected Questions and Answers for Online Room Reservation

Contact

Name
Email
Message
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!

best booking platform

Use the online hotel, flight and train booking platform to enjoy guaranteed lowest price, free cancellation, accumulation of points and more.

The most practical trip booking

After completing the reservation, make good use of the kkday/klook online booking platform to create your own exclusive itinerary before your trip.

Attractions tickets
Sightseeing itinerary
Outdoor activity
traffic ticket
Attractions tickets
Package itinerary
local experience
Accommodation project
Back to top