• I am placing an album into a template file using the do_shortcode tag provided by wordpress.

    I want to list the galleries in that album, using just the preview image, and if clicked I want that preview image to open the gallery in a lightbox.

    Next I want to display another album and display a list of its related galleries just using the gallery title and description, when clicked they open in a lightbox. I want to keep the user on the page, and use lightboxes to display the galleries.

    Can anyone point me in the right direction? I have played with the shortcode feature but can’t get these two items to work. I assume I will have to custom code some of this, just not sure where to start.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I am trying to do the same thing. I found some code for querying the database for all the galleries from nextgen but it feels a bit hack-y.

    <ul>
    <?php
    	$galleries = array();
    	$query = "SELECT * FROM wp_ngg_gallery WHERE gid";
            $result = mysql_query($query) or die(mysql_error());
    while($row = mysql_fetch_array($result)){
    	$galleries[] = $row['title'];
    }
    ?>
    <?php
    	$i = 1;
    	foreach ($galleries as &$value) {
    		echo '<li><a href="/?page_id=226&album=1&gallery='.$i.'">'.$value.'</a></li>';
    		$i++;
    	}
    ?>
    </ul>

    Make sure the page you are linking to (in this example page with id 226, but yours will be different) has shortcode for an album ( [ album id=1 template=compact ] ) otherwise it will not display the album.

    If anyone else has a more elegant solution inside nextgen to display a list of all the galleries, let me know!

    Thread Starter tjsherrill

    (@tjsherrill)

    Thanks for the reply RJM. Does anyone know how to list galleries in an album and have a lightbox open when the thumbnail is clicked?

    I can edit the template file just fine but I can’t get it to open in a lightbox.

    thoughts?

    Thread Starter tjsherrill

    (@tjsherrill)

    Ok so I have the album listing and it will open in a lightboc (colorbox) right now but I a using the $gallery->page_link so its openning the whole new page in the lightbox…

    any ideas on how to simply open the images from the gallery into the lightbox?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Nextgen gallery how to's’ is closed to new replies.