文章页怎么调用10篇最新更新文章

150203330302023-01-06  623

我对php不懂,自己闭门造车好几天了,造不出来。。。。。那位大神帮写一个

转载请注明原文地址:https://www.wellcms.net/read-594.html
12
最新回复(2)
  • well2023-1-6
    引用2
    <?php $arrlist = thread_tid_find(1, 10);
    if ($arrlist) {
        $threads = count($arrlist);
        $total = $threads > 20 ? 20 : $threads;
        $tidarr = $threads > 20 ? array_rand($arrlist, $total) : array_keys($arrlist);
        $arrlist = well_thread_find_asc($tidarr, $total);
    }
    ?>
    <?php if($arrlist){ ?>
    <div class="shadow mt-3">
        <div class="card-header bg-light">
            <h3 class="h6 font-weight-bold my-0">
                最新动态
            </h3>
        </div>
        <ul class="list-group list-group-flush">
            <!-- 循环输出主题 开始 -->
            <?php foreach($arrlist as $_thread) { ?>
            <li class="list-group-item bg-white">
                <h4 class="h6 my-0">
                    <!-- 主题链接 -->
                    <a href="<?php echo $_thread['url'];?>" class="d-block text-truncate" <?php echo (10==$_thread['type']?'rel="nofollow" target="_blank"':''); ?> title='<?php echo $_thread['subject'];?>' aria-label='<?php echo $_thread['subject'];?>'>
                        <!-- 主题 -->
                        <?php echo $_thread['subject'];?>
                    </a>
                </h4>
            </li>
            <?php } ?>
            <!-- 循环输出主题 结束 -->
        </ul>
    </div>
    <?php } ?>
    回复01
  • 谢谢.如果在限制下当前栏目最新主题,是怎么加条件得

    回复00