Oh...well the reason that it's showing up in every post is because you're changing the cached template, which is used for every post. And if you inserted the value of $counter in the template, it would of course always show a value of 1.
What you could do is, instead of modifying the cached template for every post, change it once and insert some php code that checks $post['isfirstshown']. That will get even trickier because you need to make the replacement string so that the resulting cached template is valid php code that build the string you want. (I hope that makes sense).
|