Dashicons for Frontend
-
Hello Members,
I just launched my first WP site today. During the build, I stumbled upon dashicons and incorporated them into a gallery grid/lightbox plugin(using the html snippet). Basically, I have an image of a video still and on hover the “play” dashicon appears. Once clicked, a lightbox open with the embedded video.
Little did I know at the time, the dashicons only work when I’m in Admin mode and only meant for backend use. I would like to use the icons for frontend use so users can see them in the instance described above.
I stumbled upon the below script that supposedly enables Dashicons to the frontend once added to functions.php (I do have a child theme):
//Enqueue the Dashicons script
add_action( ‘wp_enqueue_scripts’, ‘load_dashicons_front_end’ );
function load_dashicons_front_end() {
wp_enqueue_style( ‘dashicons’ );
}I didn’t see this on the official Dashicon Developer page, so I’m a little hesitant to add to the child theme functions.php file for fear of messing up the site. Has anyone tried this before?
- The topic ‘Dashicons for Frontend’ is closed to new replies.