Hello again, thanks for great support.
This time i want to add the lightbox effect to all the wordpress gallery that i upload.
So i cant find the file to edit, please let me know wich file may i have to edit so i get the lightbox effect for all my wordpress gallery.
Thanks you!
Add lightbox effect to the wp default gallery
(13 posts)
(3 voices)
-
Posted 7 months ago #
-
Hello Victorross,
Are you using the default [gallery] shortcode that Wordpress provides? If so then see here, http://mysitemyway.com/support/topic/help-with-lightbox#post-20213.
If your using the latest version of Awake then it's line 75.
Posted 7 months ago # -
I have the last Awake Theme 2.3, i am on line 75 in /wp-content/themes/infocus/lib/script/custom.js
I put this:
jQuery("a[title*='WP-GAL']").attr("rel", "prettyPhoto[gallery]"); jQuery("a[rel^='prettyPhoto'], a[rel^='lightbox']").prettyPhoto({But i do not get the ligthbox.
Did i something wrong?
Thanks
Posted 7 months ago # -
I use this code in the post to get the gallery:
[gallery link="file" columns="4" orderby="title"]Posted 7 months ago # -
One more thing, i use this little plugin:
Paginated Gallery
This make a pagination for the gallery.You can take a look here:
http://www.portalcorrientes.com/2011/10/15/los-cardales-56/Posted 7 months ago # -
Try changing it to this,
jQuery(".gallery-icon a").attr("rel", "prettyPhoto[gallery]");Posted 7 months ago # -
Not working, just to be sure i paste here my line 72-77:
/* * prettyPhoto */ jQuery(".gallery-icon a").attr("rel", "prettyPhoto[gallery]"); overlay_gallery: false, social_tools: '', 'theme': 'light_square' /* light_square / dark_rounded / light_square / dark_square / facebook */ });Posted 7 months ago # -
It needs to look like this,
jQuery(".gallery-icon a").attr("rel", "prettyPhoto[gallery]"); jQuery("a[rel^='prettyPhoto'], a[rel^='lightbox']").prettyPhoto({ overlay_gallery: false, social_tools: '', 'theme': 'light_square' /* light_square / dark_rounded / light_square / dark_square / facebook */ });Posted 7 months ago # -
Thanks a lot elliott that works great
Could you tell me how to add the alt value= post title for all the images?
RegardsPosted 7 months ago # -
I'm not sure about that. Here is the documentation for the shortcode, http://codex.wordpress.org/Gallery_Shortcode.
When you attach your images to the post there are options for setting the title and alt text. Does setting them there work?
Posted 7 months ago # -
Yes there are alt and description options, but i cant put one by one.
I will need something like this:
jQuery(".gallery-icon img").attr("alt", "CODE-TO-GET-THE-POST-TITLE");But i do not know how to get it.
It works but i do not know the function to get the post title.Thanks you
Posted 7 months ago # -
Hello,
Applying a javascript code like that one would make no difference, since you would still have to retrieve the post titles one by one. I am afraid the most convenient way will be to set the title and alt attributes in the Wordpress media manager.
Posted 7 months ago # -
Ok! Thanks for great support!
Posted 7 months ago #
Reply
You must log in to post.













