Webdesign, WordPress

Dashicons – the icon wonder weapon of WordPress

WordPress brings a bunch of nice icons with it, a little hidden but very good to use once you enable them in functions.php for the frontend:

add_action( 'ja_enqueue_scripts', 'load_dashicons_front_end' );
function load_dashicons_front_end() {
    wp_enqueue_style( 'dashicons' );

Now you just have to create a div or span in the DOM and assign two classes there:

<div class="dashicons dashicons-yes"></div>

A very nice solution here is that the icons are integrated as a font, so they can be easily recolored and animated!

An overview and all icons can be found on this page: developer.wordpress.org/resource/dashicons