Lightbox with user comments ?
-
A good solution would be to be able to add a button/icon to each image in the gallery and to link it to the attachment page. My experience with WP is too limited for the moment, so I don’t know how to do that without coding. I’m using the Astra theme + Elementor.
Another, more user friendly, solution would be as follows :
When the user click on one image in the gallery, the lightbox opens. When the user clicks again on the image in the lightbox, instead of zooming like the lightbox currently does, the attachment page would be loaded and the user could add comments.
I have started to play with the Anti Selector in the lightbox settings but obviously, I didn’t find the correct class to add there. I used the Firefox/Chrome inspector in order to determine which class I should exclude but I have not been successful. Or maybe the lightbox script prevails ?
It’s surprising that the possibility of adding comments to lightbox images has not been implemented in most galleries/lightboxes. For a photo oriented site (and especially for a photo club), it’s something that seems to be obvious. I have occasionally seen similar requests. I don’t know enough about WP for the moment to determine whether it’s too difficult to implement.
-
This reply was modified 5 years, 6 months ago by
samoreen.
Samoreen, if I am reading right - something like this might help: In the image caption - this: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Your caption_text <a href="https://yourwebsite.com"><div class = "your_link_tag">Link to comments page</div></a> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ That's it, no quotes etc, my version spit it out as working html no problem.-
This reply was modified 5 years, 6 months ago by
joefryfoto.
Hi joefryfoto,
Inserting the link into the image caption is a great idea. Thanks. I didn’t realize that the caption could embed HTML (this is my first project with WP, by the way).
Since I don’t want to handle this manually for each image in the gallery, I’ll have to determine how to insert the attachment tag automatically.
I’ll give this a try.
Thanks again.
Greetings from Fontainebleau, France.
-
This reply was modified 5 years, 6 months ago by
samoreen.
Hi again joefryfoto,
I confirm that your trick is working nicely. I just had to adapt the HREF part in your code.
Now, if I could find a way to automatically build the caption field, that would be perfect.
Thanks again.
> Now, if I could find a way to automatically build the caption field, that would be perfect.
The solution is simple. I just added this to my child theme :
add_filter( 'mwl_img_title', 'my_filter_title', 10, 3 ); function my_filter_title( $title, $id, $meta ) { return "<a href=" . get_attachment_link($id) . ">" . $title . "</a>" ; }This transforms the image title into a link to the attachment page.
Thanks for putting me on the right track.
-
This reply was modified 5 years, 6 months ago by
The topic ‘Lightbox with user comments ?’ is closed to new replies.
(@samoreen)
5 years, 6 months ago
Hi,
I’m looking for a way to have both a Lightbox and a way for users to comment a particular image in a gallery. For the moment, I can only chose between linking to the attachment page or letting the Lightbox do its job. I don’t see how I can implement this feature with both the Meow Gallery and the Meow Lightbox.
Any advice will be welcome.
Thanks in advance.
Patrick