Display all album picture thumbs on home page?

Hi,

I have 3 albums. Each album has 3 pics.

I would like a way to display my Zenphoto Home Page like:

Album 1 Title
Thumb 1 - Thumb 2 - Thumb 3

---------------------------

Album 2 Title
Thumb 1 - Thumb 2 - Thumb 3

---------------------------

Album 3 Title
Thumb 1 - Thumb 2 - Thumb 3

I'm assuming this is fairly straightfoward with some coding tweaks.
Also, after a while there may be more than 3 albums and more than 3 pics in each album.

Can anyone help?

Thank you.

Comments

  • trisweb Administrator
    Indeed, very easy.

    Just copy the code from the album.php file, in the `while (next_image()):` block, into the `while(next_album)):` block of index.php, right after the album thumbnail, in whatever HTML structure you want. Then you will get the album's images after the album thumbnail and can style it however you like.
  • Wow! That was quick. And it worked....almost.

    I get an odd error:
    [code]Fatal error: Call to a member function on a non-object in /home/mysiteuk/public_html/wordpress/zenphoto/zp-core/template-functions.php on line 307.[/code]
  • acrylian Administrator, Developer
    You need to put the `next_image` loop within the `next_album` loop (each is closed by `endwhile`).
  • Thanks for the reply! :)

    Here's my code:

    `
    <?php while (next_album()): ?>

     

    <?php echo getAlbumTitle();?>

    <?php while (next_image(false, $firstPageImages)): ?>



    <?php endwhile; ?>

    <?php endwhile; ?>
    `
    Is this correct?
  • acrylian Administrator, Developer
    That should work.
  • Hmm...strange.

    Like I say, it does display them all OK, but gives me the error and crashes my page.

    Line 307 of 'template-functions.php' is:
    return count($_zp_current_album->getSubalbums());
  • My apologies, I was being a right eejit.

    Had kept this in:

    <?php printPageListWithNav("« prev", "next »"); ?>

    *runs off, slightly ashamed*

    Thanks for the help folks!
Sign In or Register to comment.