Archived topic
Need to add some jquery to my site and need to know the best way
4 replies · Started by Ian on January 13, 2020
I have the snippets plugin installed and I have GP premium, but what is the best way to add this JQuery snippet to my site?
Do I just add it using the Snippets plugin or another way?
<script>
jQuery(document).ready(function(){
jQuery('[data-toggle="tooltip"]').tooltip();
});
</script>
I then need to add this html to the items in my price lists, but I think I know how to do that.
Hi there,
Try adding it to wp_footer hook in hooks element:
https://docs.generatepress.com/article/hooks-element-overview/
And make sure to load jQuery if you haven't done so:
https://generatepress.com/forums/topic/loading-circle-going-round/#post-939319
ok, thanks Leo.
Do I:
execute shortcodes?
execute PHP?
Neither as jQuery isn't shortcodes or PHP.
The snippet to load jQuery needs to be added using one of these methods:
Adding PHP: https://docs.generatepress.com/article/adding-php/