Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Forum: Plugins
    In reply to: Nextgen gallery how to's
    rjmcdonald

    (@rjmcdonald)

    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!

    I was just having the same issues as you were ohlenna. A fresh download and reinstall of wordpress seems to be the ticket.

Viewing 2 replies - 1 through 2 (of 2 total)