Support » Plugin: WordPress Gallery Plugin - NextGEN Gallery » Echo album ID within compact.php template

  • Hi,

    Well, I think the title says it all, how do I go about echoing the albums ID from within the compact.php template? I need to do it to be able to run some javascript on several album DIVs on one page. So I need to have the album container divs to have IDs like “album-1, album-2” etc.

    I’ve tried to echo $album->id and $this->id but it doesn’t return anything. I’m not very savvy with PHP so I’m hoping someone can help me.

    Thanks in advance, best/Dag

Viewing 2 replies - 1 through 2 (of 2 total)
  • After further googling I’ve found that using the following code, I can get to the albums data.

    global $nggdb;
    $album = $nggdb->find_album(1);
    echo $album->name;

    So the only thing left to figure out is how to dynamically check what ID the album that is loaded has, instead of having to specify an exact number. Does anyone know?


    Having the same problem…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Echo album ID within compact.php template’ is closed to new replies.