Skip to content

Using WordPress Dashicons in the frontend

ptra / Pixabay

Usually, the beautiful WordPress dashicons are available in the backend only. So if you want to use them in the frontend you have to be logged in for the according stylesheets to be loaded properly. Nevertheless , as the dashicons can be loaded simply by enqueueing the dashicons stylesheet, it is quite easy to use them in the frontend too! For information on how to use dashicons, check out the Dashicons GitHub page.

add_action( 'wp_enqueue_scripts', 'mytheme_scripts' );
/**
 * Enqueue Dashicons style for frontend use */
function mytheme_scripts() {
wp_enqueue_style( 'dashicons' );
}

Dieser Beitrag hat 0 Kommentare

Schreibe einen Kommentar

Deine E-Mail wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

An den Anfang scrollen