Add lightbox effect to the wp default gallery

resolved (13 posts) (3 voices)

  1. Victorross
    Member

    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!

    Posted 7 months ago #
  2. Elliott
    Support

    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 #
  3. Victorross
    Member

    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 #
  4. Victorross
    Member

    I use this code in the post to get the gallery:

    [gallery link="file" columns="4" orderby="title"]
    Posted 7 months ago #
  5. Victorross
    Member

    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 #
  6. Elliott
    Support

    Try changing it to this,

    jQuery(".gallery-icon a").attr("rel", "prettyPhoto[gallery]");

    Posted 7 months ago #
  7. Victorross
    Member

    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 #
  8. Elliott
    Support

    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 #
  9. Victorross
    Member

    Thanks a lot elliott that works great
    Could you tell me how to add the alt value= post title for all the images?
    Regards

    Posted 7 months ago #
  10. Elliott
    Support

    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 #
  11. Victorross
    Member

    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 #
  12. Ruderic
    Support

    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 #
  13. Victorross
    Member

    Ok! Thanks for great support!

    Posted 7 months ago #

Reply

You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme