Wordpress wp_is_mobile() function not working
问题 I have a plugin on my Wordpress that I want to block when a user is on mobile. In my functions.php I added the line: if (wp_is_mobile()) { wp_dequeue_script('flare'); wp_deregister_script('flare'); } Unfortunately, this made the script not load for both mobile and desktop users. So I need to figure out a way to make this script unload if they are on mobile. I used a similar function inside my post-template, for adding regular share buttons at the bottom of the post if they were on mobile -