WordPress i-feather not working with CDN javascript
WordPress i-feather not working with CDN javascript
I’m migrating our website https://www.meterinsight.com to WordPress and am trying to get the i-feather icons to work. I’m following this simple guide: https://therealkimcoleman.com/2022/05/21/feather-icons-with-wordpress/
In functions.php under mi_register_scripts() I have this line:
wp_enqueue_script(‘mi-ifeather’, “https://cdnjs.cloudflare.com/ajax/libs/feather-icons/4.29.1/feather.min.js”, array(), ‘1.0’, ‘all’, true);
Run code snippetExpand snippet
On the page I see that this script is being generated:
<script type=”text/javascript” src=”https://cdnjs.cloudflare.com/ajax/libs/feather-icons/4.29.1/feather.min.js?ver=1.0” id=”mi-ifeather-js”></script>
Run code snippetExpand snippet
For some reason the icons don’t show up even though in the HTML I see the simple test in the code on my web page:
What am I doing wrong?
When I added a script with “feather.replace();” it started working. I thought that’s what the feather.min.js file was for, but I guess I needed to initialize it with this.
Solution posted here: https://wordpress.org/support/topic/i-feather-not-working-with-cdn-javascript/#post-17313930
January 7, 2024
Turbo Multi-language Translator
Make the better internet purchasing globaly
Turbosify SEO Speed Booster
5.0 (7)•Free plan available
Get better conversions by improving store loading speed
Installed
Turbo Multi-language Chat - AI Customer service in one hand
January 7, 2024