Home > Backend Development > PHP Tutorial > 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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-08-26 10:12:53
Original
1364 people have browsed it

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>
Copy after login

Local PHP7, Typecho is the latest version of Github.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template