How to make so that next to each entry was a number from 1 to 10?

How to make so that next to each entry was a number from 1 to 10

loop php
to bring the numbering's court
<span class="post"><?php echo $number ?></span>
March 19th 20 at 08:53
2 answers
March 19th 20 at 08:55
Didn't think I'd ever be writing this answer

<ol>
<?php loop php { ?>
 the <li><span class="post"><?= $zapis ?></span></li>
<?php } ?>
</ol>
You can throw the code? - Katrine41 commented on March 19th 20 at 08:58
@beginner03, hahaah - maiya commented on March 19th 20 at 09:01
March 19th 20 at 08:57
for ($number=0; $number<=10; $number++){
// ....
}
You can throw the code? - Katrine41 commented on March 19th 20 at 09:00
I do this in the template wordpressa - Katrine41 commented on March 19th 20 at 09:03
@Katrine41, Well, put it in the cycle that the tag which you need, span class..... - sister.Lakin commented on March 19th 20 at 09:06
@sister.Lakin, the Trick is that the cycle itself is in a loop - Katrine41 commented on March 19th 20 at 09:09
@Katrine41, throw the code in here then - sister.Lakin commented on March 19th 20 at 09:12
Solution:

for ($number=0; $number<=1; $number++){
$num = $number;
}
?>

- Katrine41 commented on March 19th 20 at 09:15

Find more questions by tags WordPressPHP