Site logo

Archived topic

How to add jquery if not using the sticky navigation module

7 replies · Started by Gary on July 11, 2022

Viewing posts 1–8 of 8

Hi Support

Hopefully a simple request, I want to use an Elements hook to enqueue jquery on a couple of pages using a slider which still requires jquery.

By default the slider doesn't work because GP isn't including jquery as I'm not using the sticky nav which I believe is the only thing in GP that still requires jquery.

So what is the best way to add jquery manually for a couple of pages? I've found this code mentioned in previous threads but it doesn't seem to work for me:

add_action( 'wp_enqueue_scripts', 'tu_load_jquery' );
function tu_load_jquery() {
    wp_enqueue_script( 'jquery' );
}

Thanks

Hi Leo

Is there a reason I shouldn’t use an Element hook for this with tge execute php option checked?

That’s what I’m doing currently.

Thanks

Hmm because it's a function and not a hook content.

OK sorry, should have made myself clearer, I am using a hook element set to wp_footer in this case, which I’m trying to then enqueue jquery with using the snippet mentioned above. That should work correct?

Thanks

Hi Ying

OK thanks for clarifying. In that case I’ll use the snippets plugin.

Thanks

No problem :)

This archived topic is closed to new replies.