0

I have a function in my functions.php file that loads all of the scripts into the header for my website.

The line to run the function was like this:

add_action('wp_enqueue_scripts', 'init_loadjs_scripts', 100);

I'm curious if setting the priority level to 100, would in some way restrict the scripts from loading for visitors or having the priority level set that high might be throwing something off.

The problem I was facing was that a couple thumbnails on my site when they were clicked they would open a lightbox that had a video in them. I only saw this issue with Chrome and Safari. Seemed to work with Edge, Firefox, and IE.

When i removed the priority number, it worked in Chrome and Safari. I want to understand why it didnt work in Chrome/Safari when i had the priority level to 100. Is 100 to high?

1 Answer 1

2

The priority is related to other actions for the same hook. For example, if another plugin would implement add_action for wp_enqueue_scripts with a lower priority, they would have their scripts loaded in front of yours.

You should check what scripts are inserted above yours and see if there is a css conflict.

1
  • yeah i think that was it...I'm thinking jackbox or flowplayer was loading before all of my scripts and that was causing a problem. Thanks!
    – Robbiegod
    Commented Apr 26, 2016 at 21:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.