Solved: WordPress custom fonts not loading on iOS
I recently changed my WP theme to Twenty Twenty-Four and added custom fonts, but weirdly it won't be displayed on iOS while it works well on Android.
Tried numerous possible solutions and failed. But now I have a fix. It
appears the theme keeps overriding style.css
whatever you do on the
stylesheet like !important
.
Making it loaded after theme's CSS fixes the issue. Added the following
code to your theme's functions.php
:
function enqueue_custom_fonts()
add_action('wp_enqueue_scripts', 'enqueue_custom_fonts', 20);