WordPress.org

Ready to get started?Download WordPress

Forums

WP jQuery Lightbox
Galleries with custom fields (3 posts)

  1. pereiraeduardo
    Member
    Posted 2 years ago #

    Hi.

    I'm working with the plugin using custom fields, and i would like to know if it is possible to create a gallery between the images i add. Here's the code i'm using:

    $key = "Galeria" ; $gallery = get_post_meta ( $post->ID , $key , true );
    if ($gallery != "") {
    									// Separate our comma separated list into an array
    									$gallery = explode(",", $gallery);
    									//loop through our new array
    									foreach ($gallery as $picture) {
    									  echo '<a href="'.$picture.'" rel="lightbox[Galeria]"><img src="'.$picture.'"></a>';
    									}
    }

    As you can see, i try "rel='lightbox[Galeria]'", but the images don't link between them. Even if add only two images in HTML:

    <a href="http://localhost/fdm/wp-content/uploads/2012/02/mel-07-05-05_2212.jpg" rel="lightbox[109]"><img src="http://localhost/fdm/wp-content/uploads/2012/02/mel-07-05-05_2212.jpg"></a>
    							<a href="http://localhost/fdm/wp-content/uploads/2012/02/mel-07-05-05_2212.jpg" rel="lightbox[109]"><img src="http://localhost/fdm/wp-content/uploads/2012/02/mel-07-05-05_2212.jpg"></a>

    Sorry bother

    http://wordpress.org/extend/plugins/wp-jquery-lightbox/

  2. ulfben
    Member
    Plugin Author

    Posted 2 years ago #

    You're doing it right. All links-to-images sharing the same rel="lightbox[something]" will be put into a group.

    Something else is probably wrong here.

  3. pereiraeduardo
    Member
    Posted 2 years ago #

    I don't understand this behavior. It only apply a group if i create a gallery on the content field. Just for the record, i'm using toolbox theme and 2 other plugins :

    • JwPlayer
    • Contact Form 7

    Thanks for the quick answer.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic