We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Question

Gallery display the images

Hi,

On the home page I'm trying to display 4 images from the latest gallery post. I can only work out how to display the primary image (4 times).

Home Page

        <?php 
                    $opts = array(
                        'template'=>'home',
                        'image'=>true,
                        'sort-order'=>'DESC',
            'count'=>'1'
                    );
                    perch_gallery_album_listing($opts);

home.html

<perch:before>

<div class="wrap">
    <h3><strong>Why</strong> we do it</h3>


    <h4><perch:gallery id="albumTitle" /></h4>
    <p><perch:gallery id="albumExcerpt" /></p>

    <div class="clear"><br /></div>

    <span class="button">
        <a href="/projects/album.php?s=<perch:gallery id="albumSlug" />">Find out more</a>
    </span>

</div>

    <div class="images">

</perch:before>

        <a href="/projects/<perch:gallery id="main" />" title="<perch:gallery id="imageAlt" />">
            <img src="<perch:gallery id="small" />" alt=""/> 
        </a>

        <a href="/projects/<perch:gallery id="main" />" title="<perch:gallery id="imageAlt" />">
            <img src="<perch:gallery id="small" />" alt=""/> 
        </a>

        <a href="/projects/<perch:gallery id="main" />" title="<perch:gallery id="imageAlt" />">
            <img src="<perch:gallery id="small" />" alt=""/> 
        </a>

        <a href="/projects/<perch:gallery id="main" />" title="<perch:gallery id="imageAlt" />">
            <img src="<perch:gallery id="small" />" alt=""/> 
        </a>


<perch:after>    
    </div><!-- img -->
</perch:after>  

Stephen Wild

Stephen Wild 3 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you trying to list albums or images?

I'm trying to display 4 images from the latest album post

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you clarify what you mean by album post? The Gallery app has albums and images in the albums, but no posts.

Ok sorry... I want to show 4 images from within the latest gallery album

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, we don't have the concept of a 'latest' album. You can order the albums by any of their properties and then take just one.

Once you have the album, you can request 4 images.