PHP - Conditional:: Show counter when images more than 4

0 votes
246 views
added Sep 24, 2019 in PHP by lcjr First Warrant Officer (11,930 points)
<div class="thumbnails">
    <div class="thumbnail">
        <div class="image-placeholder"></div><img class="image" src="<?php print $pics[1]; ?>"></div>
    <div class="thumbnail">
        <div class="image-placeholder"></div><img class="image" src="<?php print $pics[2]; ?>"></div>
    <div class="thumbnail">
        <?php if(($pics_count - 4) > 0): ?>
            <a href="<?php print url('node/'.$row['nid']) ?>">
                <div class="photos-counter"><?php print ($pics_count - 4) ?></div>
            </a>
        <?php endif;?>
        <div class="image-placeholder"></div><img class="image" src="<?php print $pics[3]; ?>"></div>
</div>

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...