开发织梦模板的时候,在调用 dede:channel 标签时,需要将栏目中调用栏目下文章,创客云做了一下二次开发,让 channel 标签支持文章的调用:
{dede:channel type='son' noself='yes'}
[field:id runphp=yes]
global $dsql;
$sql = "SELECT arc.* FROM `mydiy_archives` arc where arc.arcrank>-1 AND arc.typeid = @me ORDER BY arc.id desc limit 10";
$dsql->SetQuery($sql);
$dsql->Execute('t');
$result = '';
while($row = $dsql->GetArray('t'))
{
$arcurl = GetOneArchive($row['id']);
$pubdate = MyDate('m-d',$row['pubdate']);
$result .= <<< TPL
<div class="am-u-sm-6"><div class="service-items h300"><div class="service-img"><img src="{$row['litpic']}" /></div><a href="{$arcurl['arcurl']}"><div class="service-title">{$row['title']}</div></a><div class="service-content">{$row['description']}</div></div></div>
TPL;
}
@me = $result;
[/field:id]
{/dede:channel}
专业提供WordPress主题安装、深度汉化、加速优化等各类网站建设服务,详询在线客服!