Skip Navigation

[Resolved] Split: Font Awesome icons not working after updating to Types 3.x

This thread is resolved. Here is a description of the problem and solution.

Problem:
Font Awesome icons are not working, because of a version clash between Toolset (v4) and the theme (v5).

Solution:
We haven't updated our plugins yet, but you should be able to use the following code to resolve the problem.

It dequeues/deregisters the existing font awesome stylesheets (where both Toolset and another plugin or theme have registered different versions with the same handle), so that you can re-register the stylesheet for Font Awesome version 5.

You'll need to locate the source of the font awesome stylesheet you want to use (e.g. from your theme) and edit the code below to use that source.

function fix_different_version_same_handle_script() {
     
    //Dequeue/Deregister any conflicting script
    wp_dequeue_style( 'font-awesome' );
    wp_deregister_style( 'font-awesome' );
 
    //Re-enqueue the desired script with a different handle - change $src adequately)
    wp_enqueue_style('font-awesome-compatible', get_template_directory_uri() . '/assets/font-awesome-v5/css/fontawesome-all' . $min . '.css');
 
}
add_action( 'wp_enqueue_scripts', 'fix_different_version_same_handle_script', 20 );
This support ticket is created 6 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 4 replies, has 2 voices.

Last updated by michaelA-13 6 years, 3 months ago.

Assisted by: Nigel.

Author
Posts
#1085642

Hi Nigel,

That seems to be resolved 🙂 Thx

I now noticed that with types active (as of my instilling the newest version recently) my font awesome icons do not work. anymore.

Can be seen on homepage.

As soon as I deactivate types all is good again.

Michael

#1085760

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Michael

It seems we are behind the curve with Font Awesome, still on version 4, whereas some themes have upgraded to version 5, which is causing a conflict.

We have an internal ticket to migrate to version 5 and resolve possible conflicts, but that work isn't complete.

There is a possible temporary workaround described in that ticket, but it is not clearly explained.

I've asked for clarification, and I'll get back to you.

#1092845

Hi Nigel,

any update on this matter?

Michael

#1092905

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Michael

We haven't updated our plugins yet, but you should be able to use the following code to resolve the problem.

It dequeues/deregisters the existing font awesome stylesheets (where both Toolset and another plugin or theme have registered different versions with the same handle), so that you can re-register the stylesheet for Font Awesome version 5.

You'll need to locate the source of the font awesome stylesheet you want to use (e.g. from your theme) and edit the code below to use that source.

function fix_different_version_same_handle_script() {
    
    //Dequeue/Deregister any conflicting script
    wp_dequeue_style( 'font-awesome' );
    wp_deregister_style( 'font-awesome' );

    //Re-enqueue the desired script with a different handle - change $src adequately)
    wp_enqueue_style('font-awesome-compatible', get_template_directory_uri() . '/assets/font-awesome-v5/css/fontawesome-all' . $min . '.css');

}
add_action( 'wp_enqueue_scripts', 'fix_different_version_same_handle_script', 20 );

Can you try that and let me know how you get on?

#1093809

Resolved Thanks