Part of the code is responsible for calling tags in the list of articles. How to set a maximum of 5 tags for example. thank
<?php $tags = K2ModelItem::getItemTags($item->id); for ($i=0; $i<sizeof($tags); $i++) { $tags[$i]->link = JRoute::_(K2HelperRoute::getTagRoute($tags[$i]->name)); } $item->tags=$tags; ?> <?php if(count($item->tags)): ?> <!-- Item tags --> <?php foreach ($item->tags as $tag): ?> <li><a href="<?php echo $tag->link; ?>"><?php echo $tag->name; ?></a></li> <?php endforeach; ?>