Forum

Thread tagged as: Question, Blog

Hide empty blog post tags

Hi, I am calling post tags in my post.php page:

<?php perch_blog_post_tags(perch_get('s'), 'mis-tags.html'); ?>

but it displays all tags:

- soccer(1)
- baseball ()
- basketball (4)
- rugby ()

Is there any chance to hide those empty tags? Here is my template:

<perch:before><ul class="tags"></perch:before>
        <li><a href="archive.php?tag=<perch:blog id="tagSlug" />" rel="tag"><perch:blog id="tagTitle" /> (<perch:blog id="qty" />)</a></li>
<perch:after></ul></perch:after>

Thanks

Raul Serrano

Raul Serrano 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You can test for qty:

<perch:if exists="qty">
...
</perch:if>

It doesn't work... I just take out the (<perch:blog id="qty" />) and it's fine for now.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you in production mode? If so, it's cached.