织梦arclist标签idlist按指定id顺序输出

1、打开 /include/taglib/arclist.lib.php 找到,大概在第338行

else if($orderby == 'rand') $ordersql = " ORDER BY rand()";  

在它下面加入一行

else if($orderby == 'idlist') $ordersql = " ORDER BY FIELD(arc.id,$idlist)";  

2、dede:arclist idlist='' 标签里加入orderby='idlist'

例如

{dede:arclist idlist='1,2,4,6,10' orderby='idlist'} <li><a href=http://www.dede58.com/"[field:arcurl/]">[field:id/] - [field:title/]</a></li> {/dede:arclist}  

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/4b3dd262adb94cce42d4e78d6b21126d.html