Info
- 2 posts
- 2 voices
- Started 4 years ago by rolanddeschain
- Latest reply from livibetter
- This topic is not resolved
Sticky on "Latest Discussions"
-
- Posted 4 years ago #
I'd like my sticky threads to act exactly like regular threads on the front page "Latest Discussions" section, instead of always being at the top of the list. That is, they'd still appear on the list, but in the order of last posting - the same as all the usual threads.
Is there any easy fix?
-
- Posted 4 years ago #
There are two
ifblocks infront-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.
-
You must log in to post.