How to use for loop in php wordpress?

Use for loop in php wordpress.

Following demo to use php in wordpress.


<?php
for ($i = 0; $i < 10; $i++)
{
echo '<div class="pin">

<a href="#" title="Photo number 1" pin_id="1">
<img alt="Photo number 1" src="photos/pic1.jpg">
</a>

</div>';
echo '<div class="pin">

<a href="#" title="Photo number 4">
<img alt="Photo number 4" src="photos/pic4.jpg">
</a>

</div>';
}
?>

About the Author

avatar