PHP Notice: Function is_page was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false
Your code looked good to me, so I believed that the PHP notice was unlikely caused by the code in question. But that issue could probably be caused by a previous version of that code. E.g. If you had used the init and not wp_enqueue_scripts hook to enqueue your script, then such notice is expected, … Read more