Hi,
I am having trouble getting lightbox to work for my images. Using DIVI child-theme
Page where this issue is happening: hidden link
I added thickbox to my childtheme functions.php using the following code:
add_action( 'wp_enqueue_scripts', 'add_thickbox' );
I have tried to add class="thickbox" to my content template but the link isn't opening the image, it opens the whole page in a lightbox. Can you please tell me the syntax I need to use for this field?
I'm not particularly familiar with using thickbox, but looking at the code you are using, it seems like you are adding thickbox wrongly, you need to run the add_thickbox() function, you don't enqueue it. Then the question becomes where you run the function.
You can add the PHP code to your functions.php file or as a snippet at Toolset > Settings > Custom Code (activate and make sure it runs on the front end).
I'm not sure what "" means.
When I visit the link I can see that the links for the images are malformed, look at the href for the link:
It includes two URLs as the link, which explains why the thickbox lightbox isn't working. (I edited the href in the browser dev tools to include just one link, and then it worked.)
So the problem lies in how you are generating the markup for the link and images.
If this is a repeating image field you need to use a wpv-for-each shortcode loop to iterate over the field values and output one link with image for each image field value.