DevDmBootstrap4

Twitter Bootstrap 4 WordPress Starter Theme for Developers

Adding Font Awesome Pro

How Can We Help?

Adding Font Awesome Pro

You are here:
< Back

If you have purchased Font Awesome Pro and wish to enqueue it into your child theme you need to include a code snippet like the one below inside your child theme’s functions.php file.

The code snippet below dequeues and deregisters the parent theme devdmbootstrap4’s font awesome free stylesheet. It has a handle of devdmbootstrap4-fontawesome.

Once the old font awesome is removed we enqueue the Font Awesome Pro stylesheet. This code snippet assumes your Font Awesome Pro stylesheet is located at: your-child-theme/assets/font_awesome_pro/css/fontawesome-all.css

You will want to adjust the path to fontawesome-all.css if you put it somewhere else inside your child theme.

/**
 * Dequeue default devdmbootstrap4-fontawesome css and enqueue the Font Awesome pro version
 */
add_action( 'wp_enqueue_scripts', 'theme_slug_fontawesome_pro', 20 );

function theme_slug_fontawesome_pro() {
    wp_dequeue_style( 'devdmbootstrap4-fontawesome' );
    wp_deregister_style( 'devdmbootstrap4-fontawesome' );

    wp_enqueue_style('fontawesome_pro', get_stylesheet_directory_uri() .'/assets/font_awesome_pro/css/fontawesome-all.css');
    wp_enqueue_style( 'fontawesome_pro' );
}
Table of Contents