typecho 文章内运行php,typecho-用typecho做CMS每个分类输出5篇文章的函数

宇文智敏
2023-12-01

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

用typecho做CMS每个分类输出5篇文章的函数

版本一:(模板里限定了pageSize=5---sky)

widget('Widget_Metas_Category_List')->to($metas); ?>

next()): ?>

name(); ?>

mid ;

$this->widget("Widget_Archive@$myCustomCategory",'type=category', "mid= $metas->mid")->parse('{title}'); ?>

<?php $this->widget('Widget_Metas_Category_List')->to($metas); ?>

<?php while($metas->next()): ?>

<?php $metas->name(); ?>

$myCustomCategory = "myCustomCategory".$metas->mid ;

$this->widget("Widget_Archive@$myCustomCategory",'type=category', "mid= $metas->mid")->parse('

{title}'); ?>

版本二:(后台设置的pageSize----华天)

widget("Widget_Archive@$metas->mid" ,"pageSize=5&type=category", "mid= $metas->mid")->parse('{title}'); ?><?php $this->widget("Widget_Archive@$metas->mid" ,"pageSize=5&type=category", "mid= $metas->mid")->parse('

{title}'); ?>
 类似资料: