Hey guys,
I was wondering how to create a loop through the Parent-Album (UrAlbum) when i am viewing a sub-album page.
currently my loop looks like:
<?php while (next_image(true, $firstPageImages)):
do stuff;
endwhile; ?>
Is there any way to tell the loop function to check the parent album instead of the current sub-album?
Comments
Btw, the parent album is not necessarily the uralbum. The latter refers to the top level parent.
I already used:
$uralbumobj = getUrAlbum($_zp_current_album);
To Show Custom Album Fields from my UrAlbum.
Is there no simple way to connect the loop the the "$uralbumobj" Object as well?
Make a copy of the "next_image" function, name it "nextUr_image". Put this function into the template "functions.php", add this line on top :
`$_zp_parent_album = getUrAlbum($_zp_current_album);`
and replaced all "$_zp_current_album" in the function with "$_zp_parent_album". Now you can write your loop on the album.php page like this:
`
while (nextUr_image()):
`
And you will have a query through your Top-Level Parent Album, while you're on a sub-album page.