Archived topic
jquery not working for me?
9 replies · Started by Melissa on July 29, 2019
I use justified image grid to display posts and galleries and I'm trying to use jquery to make the captions below the images clickable.
They said to use this jquery:
jQuery('.jig-imageContainer').on('click','.jig-caption-wrapper',function(){ location = jQuery(this).prev().find('a').attr("href"); });
which I put in a <script> tag in an element that loads in wp_footer.
I'm not seeing any effect.
Do you have any advice?
Hi there,
Have you checked with their support or make sure the code works in a default twenty series themes?
GeneratePress itself can't really interfere with the code.
Yeah, unfortunately their support just said that it was tested and should work.
Just wondered if you had advice. I'll keep trying.
Do they have specific instructions on where to add it?
No. I thought the footer was the right place?
It should be.
Does it work if you use a default WP theme?
I'm not sure. Generatepress elements won't keep working if I change themes, right?
Yup you'd have to add it using function.
wp_footer is a WordPress hook though it should be the same in the default theme.
I'll try to do that tomorrow.
Thanks!
Sounds good.
Hopefully you've sorted this :)