ZenphotoCMS Forum
Display all album picture thumbs on home page? - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Display all album picture thumbs on home page? (/thread-3818.html)



Display all album picture thumbs on home page? - invision - 2008-09-29

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.




Display all album picture thumbs on home page? - trisweb - 2008-09-29

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.




Display all album picture thumbs on home page? - invision - 2008-09-29

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]




Display all album picture thumbs on home page? - acrylian - 2008-09-29

You need to put the next_image loop within the next_album loop (each is closed by endwhile).




Display all album picture thumbs on home page? - invision - 2008-09-29

Thanks for the reply!

Here's my code:

`

                 







                        ">

`
Is this correct?




Display all album picture thumbs on home page? - acrylian - 2008-09-29

That should work.




Display all album picture thumbs on home page? - invision - 2008-09-29

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());




Display all album picture thumbs on home page? - invision - 2008-09-29

My apologies, I was being a right eejit.

Had kept this in:

runs off, slightly ashamed

Thanks for the help folks!