Forum
How to get the album image
OK, so how do I grab the album image here? I have just put $album['albumImage'] but that is clearly not right.
<?php
$albums = perch_gallery_album_listing([
'image'=>true,
'skip-template' => true,
]);
?>
<ul>
<?php
foreach ($albums as $album) {
echo '<li><a href="?s='.$album['albumSlug'].'"<img src="'.$album['albumImage'].'" /></a><a href="?s='.$album['albumSlug'].'"><h2>'.$album['albumTitle'].'</h2></a></li>';
}
?></ul>
Ultimately I want to be able to check if the current slug matches the album slug and to add a class to the image, but I have got stuck even adding the image so far!
What does this give you?
Sorry, I didn't get email notification of your reply.
If you replace
with
what does that get you?
Nothing :(
oohhh, this works though:
OK, so how can I pull the resized image rather than the original one then?
Aha! Got it!