Reverse chronological order (newest entries first) for News Feed?

Stephen Holton Posted in Performance and Scalability 5 years ago

Is there any easy way to reverse the chronological order of the News Feed to more readily match Facebook and show newest entries first, vs having to scroll through the full history?

Replies
Indonesian Arsalan Shah Replied 5 years ago

That is why never install anything blindly :)

Catalan Stephen Holton Replied 5 years ago

I found that there was a component called "Newsfeed Post Order" that I must have installed by accident that was putting my feed in older-first order. I've since disabled it and all is good now.

gb Rishi B Replied 5 years ago

Um, the most recent news feed posts already do show up first, but if you want to modify the order they're shown in, it's in the OssnWall class (components/OssnWall/classes/OssnWall.php) in the GetPosts() function. It looks like this by default:

$default = array(
                        'subtype' => 'wall',
                        'order_by' => 'o.guid DESC'
                );

so for example, if you wanted to display in chronological order, you could change that DESC to ASC.