A lazy short circuit solution which makes the first displayed entry in a loop appear different:
$special="specialClass normalClass";
for {
echo ... class="$special" ...
$special="normalClass";
}
Sounds difficult to set up:)
I understand that I create a variable but how do I make it make the difference between the posts.
I found a bb_is_first and I am thinking in using this one somehow.
It doesn’t have to know the difference. You set
$special
to be a special class before the loop, then the last thing you do in the loop is set
$special
to be something else. So the first time round the loop
$special
has it’s original value, then at the end of the first loop it’s value is changed (so it’s no longer the initial value).
The fact that the value is repeatedly reset to the other value is irrelevant (there is overhead in this, but it’s comparable to calling a function each time round the loop to check for “is this the first item” and it has the advantage that it’s not API specific.