织梦模板首页和列表页文章按权重排序

2025-08-04 0 6
  • dede:arclist 按权重排序输出文章
需要打开 /include/taglib/arclist.lib.php 找到
else if($orderby == ‘rand’) $ordersql = ”  ORDER BY rand()”;
在它的下面加入
else if($orderby == ‘weight’) $ordersql = ”  order by arc.weight $orderWay”;
dede:arclist 按权重排序的标签写法
{dede:arclist typeid=’1′ row=’8′ isweight=’y’ orderby=’weight’ orderway=’asc’}
<li><span>权重:[field:weight /]</span><a href=”[field:arcurl /]”>[field:title /]</a></li>
{/dede:arclist}
  • dede:list 按权重排序输出文章
需要打开 /include/arc.listview.class.php 找到
else if($orderby==”lastpost”) {
在它的上面加入
else if($orderby == ‘weight’) {
$ordersql = ”  ORDER BY arc.weight $orderWay”;
}
图解
织梦模板首页和列表页文章按权重排序
继续找到
/hot|click|lastpost
改成
/hot|click|lastpost|weight
图解
织梦模板首页和列表页文章按权重排序
dede:list 按权重排序的标签写法
{dede:list pagesize=’10’ orderby=’weight’ orderway=’asc’}
<li>
    <a href=”[field:arcurl/]” class=”title”>[field:title/]</a>
    <p class=”intro”> [field:description/]… </p>
</li>
{/dede:list}
提示:权重排序都是以越小值排在越前面
收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

版权声明:所有的源码、软件和资料,不得使用于非法商业用途,不得违反国家法律,一切关于该资源商业行为与本站无关。

免费cms模板 dedecms教程 织梦模板首页和列表页文章按权重排序 https://www.mianfeicms.com/1220.html

相关文章

发表评论
暂无评论