返回归档

Laravel

Typecho调用最新文章

用法

在需要调用的地方添加

<?php
$this->widget('Widget_Contents_Post_Recent','pageSize=10')->to($recent);
if($recent->have()):
while($recent->next()):
?>

<li><a href="<?php $recent->permalink();?>"><?php $recent->title();?></a></li>

<?php endwhile; endif;?>

备注

这是从旧博客迁移过来的代码片段,适合在遇到同类问题时快速参考。