Hi there,
is there a way to divide pinned topics from normal ones? Maybe with to loops in the spForumView?
I would like to display the pinned topics with a different header.
Greetings
Hi there,
is there a way to divide pinned topics from normal ones? Maybe with to loops in the spForumView?
I would like to display the pinned topics with a different header.
Greetings
you could do multiple loops… you could use a filter to change the query for first loop to only give you pinned topics and the filter the query again on second loop to only get non pinned topics..
or maybe use some CSS since pinned topics have their own class applied… so you could highlight the pinned topic in different color, or add a border on bottom of last one…
lots of options really…
There is actually a pretty easy way now. You can use CSS to color the actual forum topic section to a different color if a topic is pinned. You do so using the spPinnedTopic class.
Something like
Then if you want a header above and below the pinned topics you could do this at the start of the topic display loop in soForumView.php




Brandon C said
There is actually a pretty easy way now. You can use CSS to color the actual forum topic section to a different color if a topic is pinned. You do so using the spPinnedTopic class.Something like
.spForumTopicSection.spPinnedTopic {background: #color !important;In which file would I put that code above? And does placement matter?
Robb G said In which file would I put that code above? And does placement matter?
There are several ways and places you can add it. If you have a custom Simple:Press theme you can add it to the bottom of your theme’s php file or CSS file. If not running a custom theme you can even put it in the forum page itself by adding it manually to the page.
For example if you go to your forum page in WordPress and add this to it in text/problem-with-post-edit-buttontml mode only..
<style media="screen" type="text/css">
.spForumTopicSection.spPinnedTopic {
background: #color !important;
</style>
It will add that CSS to your forum page when it loads. Lots of ways to do it but the most efficient is having a custom SP theme and adding it to that.
Thanks. I followed your instructions and it worked. I used my custom theme. With this, I don’t really need the featured topics plugin.