Sign in QQ login WeChat login
All categories

Z-blogPHP website articles have multiple tags, only the first three are displayed

finchui five hundred and thirteen 2023-04-26 11:12:56

The following code can be used in the column list or article detail page.

 {foreach array_slice($article.Tags,0,3) as $tag}<a href="{$tag.Url}" title="{$tag.Name}">{$tag.Name}</a>{/foreach}

In addition, you can also add {if $article. Tags} to determine whether there is a tag. If there is no tag, it will not be displayed! As shown in the figure below:

 image.png

  • Dislike( three

Link to this article: https://www.finchui.com/zblog-course/18.html

Netizen comments

Hot commodity
Popular articles
Hot tags
Related labels
 FinchUI Store Edition

share

Copy Link

Xinglan Studio Online consultation

Working hours: 9:00-22:00
Saturday and Sunday: 14:00-22:00