Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Detecting whether a post is the first in a topic

Lookfab, here’s a slight tweak to the default kakumei topic.php theme file that should do what you want:

<ol id="thread" start="<?php echo $list_start; ?>">

<?php $i = 0; ?>

<?php foreach ($posts as $bb_post) : $del_class = post_del_class(); ?>

<li id="post-<?php post_id(); ?>"<?php if ($i == 0) { echo 'class="firstpost"'; } elseif !($i % 2) { echo ('class="alt"'); }?>>

<?php bb_post_template(); ?>

</li>

<?php $i++; ?>

<?php endforeach; ?>

</ol>

You can then style the class “firstpost” using CSS to make it stand out however you want…

I didn’t test this, but I think it should work either by itself or with a tweak or two.

Skip to toolbar