Have you set your priority number higher than others loading in the footer?
For example, here I used 999999…
add_action( 'wp_enqueue_scripts', 'cpar_enqueue_later', 999999 );
function cpar_enqueue_later() {
wp_enqueue_script( 'myscript', get_template_directory_uri() . '/js/scripts.js', array( 'jquery' ), '', true );
}
-
This reply was modified 3 years, 9 months ago by bcworkz. Reason: code format fixed
Personally, I have not played much with the wp_is_mobile() function; but what I can share (and hopefully help give you more info to investigate) is that I have seen issues with caching in the past. I have not used it on any production websites either.
Also, I believe many have recommended not to use wp_is_mobile() in themes. (Not sure reasoning)