当前位置:首页 > 未命名

zblog调用指定tag文章列表的方法

8976988823个月前 (01-10)未命名5

我们在做zblog主题中常常需要调用指定tag的文章列表,这样可以让网站内容的类别多样,展示更加丰富。

用下面的调用代码就可以实现:

{$array=Getlist(9,null,null,null,array($zbp->GetTagByID(242),$zbp->GetTagByAliasOrName('phptheme')));} {foreach $array as $article}          {template:thumbnail}<div class="theme-item">						<div class="theme-item-box">							<div class="theme-bg" style="background:url({$temp}) no-repeat center top; background-size:cover;"><a href="{$article.Url}" title="{$article.Title}" target="_blank"></a>							</div>							<div class="theme-title">								<h3><a href="{$article.Url}" class="overdot work-title" target="_blank" title="{$article.Title}">{$article.Title}</a></h3>								<div class="theme-description">{$article.Intro}</div>								<div class="theme-meta">									<div class="theme-meta-price">										<div class="download-meta-price-details">											<a href="{$article.Category.Url}" rel="bookmark"><span class="edd_price">{$article.Category.Name}</span></a></div>									</div><div class="theme-meta-name">										<span class="author vcard"><i class="fa fa-eye"></i>{$article.ViewNums}</span>									</div>								</div>							</div>						</div>					</div>{/foreach}

代码中数字9是指调用的文章数量,242是tag标签的id,phpheme是标签的别名。

以上内容可以根据自己的需求进行调整。

扫描二维码推送至手机访问。

版权声明:本文由米表程序发布,如需转载请注明出处。

本文链接:https://www.9909999.xyz/post/25.html

分享给朋友: