Home  >  Article  >  Backend Development  >  Typecho popular articles and other sidebars add sorting numbers and output blank spaces

Typecho popular articles and other sidebars add sorting numbers and output blank spaces

WBOY
WBOYOriginal
2016-08-26 10:12:531276browse

As in the title, the sidebars of Typecho popular articles and other columns add sorting numbers and output blank spaces.
The code is as follows:

<code><?php $i = 1; ?>
<?php while($post->next()): ?>
<li><span class="label label-<?php echo $i; ?>"><?php echo $i; ?></span>
<a href="<?php $post->permalink(); ?>"><?php $post->title(); ?></a></li>
<?php $i++; ?>
<?php endwhile; ?></code>

Local PHP7, Typecho is the latest version of Github.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn