Hi all,
I am using the features widget and the the fontawesome ‘shopping cart’ icon with it. Similarly, my theme also includes the fontawesome icons and again I am using the same icon with my navigation menus. See trial website here:
Is there a way of redirecting the widget to source it’s fontawesome icons from my theme fontawesome directory rather than it’s own? This would negate the need for a visitor’s browser to load the same icon file twice (once from the theme fontawesome directory for the nav menu and again from the widget directory for the feature)?
Any advice greatly appreciated!
Best regards and thanks,
Richard
Hi Richard
Thanks for reaching out.
This is a problem, hopefully, as WordPress progresses we’ll avoid it using standard handles to prevent unnecessary dependency loading. Out of interest, a project attempting to define all the standard handles can be found here: https://github.com/grappler/wp-standard-handles.
The easiest would be to use a child theme to deregister Font Awesome from your theme, I think. It’s something you’d need to test out. If you’re using a premium theme, perhaps this is something theme support could assist with?
Thanks very much for the reply.
Is it not possible to deregister Font awesome from your plug in instead and have it use the theme’s?
If so, do you think the following code looks like something that may be useful to me:
Cheers,
Richard
Found a simpler solution – gone into ‘/wp-content/plugins/so-widgets-bundle/icons/fontawesome/style.css’ and changed urls to point towards theme’s fonts, e.g.:
from ‘font/fontawesome-webfont.woff2?v=4.4.0’
to ‘/wp-content/themes/mts_schema/fonts/fontawesome-webfont.woff2’
Regards,
Richard
Hi Richard
Super, glad to hear you’ve made progress.
Please, keep in mind that because all WordPress themes and plugins overwrite their own folder during updates you’d either need to redo this change after updating the Widgets Bundle or not update the Widgets Bundle.