Last active
June 20, 2022 18:40
Star
You must be signed in to star a gist
Add document.url as a hidden field
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you need to load your function very late on the page (i.e., after modals or popups), then change line 16 to this.
<?php }, 500 );
Increase 500 all the way up to 900 as needed. The higher the number the lower down in your page your code will load.
This isn't a guarantee since some plugins and themes are greedy and want to be the very last thing loaded (to override everything else).
If that's the case, you might need to wrap the JS in
setTimeout()
to delay the load even longer.