agtalpai
Member
Posted 6 years ago #
hi, i want to modify my template, and make my post different, so i would like to know, if there's any way to number my post divs like id="post1" id="post2" id="post3" id="post4"...
i know it's some sort of ++ and foreach problem, but i'm really a php noob...
thanks for your help indeed!
Syllani
Member
Posted 6 years ago #
Not sure of the problem, in the default theme it is there already:
<div class="post" id="post-<?php the_ID(); ?>">
If your intention is to have unique styling for each post. Then you an set a simple variable called $i = 0; and then just do $i++ each time through The Loop and use it in the div.
Perhaps you could tell us a little more about what you are trying to accomplish..
Regards