• Resolved psm9640

    (@psm9640)


    Hi there –

    I’m working on a child theme based on BlankSlate where I’m deferring jQuery and jQuery-dependent scripts to the footer. Problem is that when I do this I get the dreaded “jQuery is not defined” error due to the fact that the blankslate_footer function is loaded via add_action earlier than jQuery.

    Wondering if in a future release it would be possible to add a priority to line 32 of functions.php in the current release to ensure it wouldn’t load as early. My modification that worked — simply adding a higher number to lower priority — looked like this:

    add_action( 'wp_footer', 'blankslate_footer', 30 );

    Thank you very much!

    PM

Viewing 1 replies (of 1 total)
  • Theme Author Bryan Hadaway

    (@bhadaway)

    The only problem with that is that it may help with your specific issue, but I’m not sure it’s beneficial to the majority of users. Can you share the jQuery you’re trying to add? I might be able to help you in another way.

Viewing 1 replies (of 1 total)
  • The topic ‘Add Priority for blankslate_footer in functions.php’ is closed to new replies.