Gallery count if

  • I'm using the following to bring in 4 gallery posts to the home page... works fine.



    PHP
    1. <?php
    2. $opts = array(
    3. 'template'=>'home.html',
    4. 'image'=>true,
    5. 'sort-order'=>'DESC',
    6. 'count' => '4'
    7. );
    8. perch_gallery_album_listing($opts);
    9. ?>


    What I'm wanting to know is it possible to do an "if"...

    Basically I want it to show an ad in the place of a gallery post, if there's less than 4 gallery's... show 2 ad's if theres less than 3 gallery's etc...


    Thanks

  • drewm

    Approved the thread.