Dashicons in wordpress (frontend) won't display
Solution 1
Dashicons is the official icon font of the WordPress admin as of 3.8..
To load Dashicons for non logged in users:
- Open directory
{your-website-folder/wp-content/themes/}
- Go into the folder of your active child theme ( if you don't have active child theme, open the folder of your active parent theme )
-
Find there
functions.php
file and add the provided code at the end of it ( make sure, there isn't?>
php closing tag at the end of file. if so, just remove it ):function ww_load_dashicons(){ wp_enqueue_style('dashicons'); } add_action('wp_enqueue_scripts', 'ww_load_dashicons');
Save changes. Dashicons will loads on your website for all users.
EDIT: there may be some plugin/code, which removed Dashicons from pages. Try to change your code with this one:
function ww_load_dashicons(){
wp_enqueue_style('dashicons');
}
add_action('wp_enqueue_scripts', 'ww_load_dashicons', 999);
Solution 2
Try this:
<span class="bx-next dashicons dashicons-arrow-right-alt2"></span>
'dashicons-arrow-right-alt2' is the class of the icon. You can find them here: https://developer.wordpress.org/resource/dashicons/#arrow-up-alt
This has to go to your functions.php file:
function load_dashicons(){
wp_enqueue_style('dashicons');
}
add_action('wp_enqueue_scripts', 'load_dashicons');
Admin
Updated on June 26, 2022Comments
-
Admin almost 2 years
Currently, I'm busy creating a website in WordPress. I'm using dashicons for rating ( manualy ) holidays. It used to work, but after update the dashicons won't be visible for non-logged in users. Only, if you login, you can see the star ratings.
The star rating should be visible on the left top of each holiday deal.
Who knows a solution?
Website url is www.ikwilopvakantie.nl
-
Admin about 6 yearsHi The code is already in my functions.php file (i already added this). But still the same issue...
-
Admin about 6 yearsHumm still nothing, i see the square signs instead of the star dashicon...
-
Samvel Aleqsanyan about 6 yearsyou have some cache plugin in your website. clear all cache from plugin, also, clear cache from browser
-
Admin about 6 yearsYep, i deleted all cache in website and cloudflare. Im also using firefox private browser with the setting to don't cache websites... But nothing happens... Do you still see the squares of do you see the stars (top left of a block)
-
Samvel Aleqsanyan about 6 yearsyour cache plugin is still active. delete all cache and deactivate it/remove all settings. can you confirm, that the provided code still in the functions.php file of active theme?
-
Xarcell over 5 yearsI am having the same problem in version 5.0.
-
Samvel Aleqsanyan over 5 years@Xarcell did you try provided answer?
-
Xarcell over 5 yearsMy problem was I was using my own HTML, and forgot to add the dashicons font-family to it.