Typecho 标签云+一篇该标签文章

No Reply , Posted in 代码 on September 9, 2014

<ul class="tag-clouds">
         <?php $this-&gt;widget('Widget_Metas_Tag_Cloud', array('sort' =&gt; 'count', 'ignoreZeroCount' =&gt; true, 'desc' =&gt; true, 'limit' =&gt; 60))-&gt;to($tags); ?>
                        <?php while($tags->next()): ?>
         <li><a class="tagname" href="<?php $tags-&gt;permalink(); ?&gt;"&gt;&lt;?php $tags->name(); ?></a><strong>x <?php $tags->count(); ?></strong><br>
                            <?php $this-&gt;widget('Widget_Archive@tag-' . $tags->mid, 'pageSize=1&type=tag', 'mid=' . $tags-&gt;mid)-&gt;to($posts); ?> 
                            <?php while ($posts->next()): ?>
                            <a href="<?php $posts-&gt;permalink(); ?&gt;"&gt;&lt;?php $posts->title(); ?></a><br><span class="muted"><?php $posts->date('Y-m-d'); ?></span></li>
                            <?php endwhile; ?>
                        <?php endwhile; ?>
      </ul>

说明:

'limit' => 60 //60条标签记录
pageSize=1 //该标签下的1篇文章

标签: 标签