Re: Sticky on “Latest Discussions”
There are two if
blocks in front-page.php
, one for $super_stickies
, another for $topics
. Remove first one(about 8 lines) and replace second with
<?php
$stickyIdx = 0; $topicIdx = 0;
while ($stickyIdx < count($super_stickies) && $topicIdx < count($topics)) {
if ($super_stickies[$stickyIdx]->topic_time > $topics[$topicIdx]->topic_time)
array_splice($topics, $topicIdx, 0, array($super_stickies[$stickyIdx++]));
$topicIdx++;
}
if ($stickyIdx < count($super_stickies))
array_splice($topics, count($topics), 0, array_slice($super_stickies, $stickyIdx));
if ( $topics ) : foreach ( $topics as $topic ) : ?>
<tr<?php topic_class(); ?>>
<td><a href="<?php topic_link(); ?>"><?php topic_title(); ?></a></td>
<td class="num"><?php topic_posts(); ?></td>
<td class="num"><?php topic_last_poster(); ?></td>
<td class="num"><small><?php topic_time(); ?></small></td>
</tr>
<?php endforeach; endif; // $topics ?>
Actually, the replacement is equivalent to inserting 8 lines of code.