Notifications
Clear all

wpForo 1.x.x [Solved] I want my topics to show " latest reply to oldest reply"

12 Posts
5 Users
7 Likes
2,161 Views
om.vitalii
Posts: 8
Topic starter
(@om-vitalii)
Active Member
Joined: 2 years ago

Hi! How can I make the new reply higher abouv the older one?

11 Replies
2 Replies
Robert
Admin
(@robert)
Joined: 6 years ago

Support Team
Posts: 9373

@om-vitalii, Please let me know what forum layout you use?

om.vitalii
(@om-vitalii)
Joined: 2 years ago

Active Member
Posts: 8

I use 4th layout (threaded). I`ve seen your old reply here https://wpforo.com/community/how-to-and-troubleshooting-2/how-to-sort-posts-in-a-thread-oldest-first/#post-15418

but seems templates are changed from 2018 and now In Index I see this

elseif( in_array(WPF()->current_object['template'], array('forum', 'topic')) ){
wpforo_template('forum');
if( WPF()->current_object['template'] === 'topic' ){
wpforo_template('topic');

So I need topic.php

In topic.php I see reference to layout-4-topic.php, where no args or loop appear. Do you have a modern answear to how fix my issue? Posts should be inverted order on screen

Hope you will help me, best wishes

Robert
Posts: 9373
Admin
(@robert)
Support Team
Joined: 6 years ago

@om-vitalii,

Unfortunately the peace of code is moved to a core file. So there is no way to do this customization. In upcoming version, we'll add a new hook in the core file and let you do this change. I don't have any ETA yet. Just update this topic, once the next version is released.

alexas
Posts: 34
(@alexas)
Eminent Member
Joined: 5 years ago

Dear plugin developers, I also really need the last comment to be the first in the topic. To be like on YouTube. In this case, the description of the topic 1 comment was always on top for SEO. I can't wait for the results of your work! Respect

Martin
Posts: 866
Moderator
(@martin)
Support Team
Joined: 6 years ago
Posted by: @alexas

Dear plugin developers, I also really need the last comment to be the first in the topic. To be like on YouTube. In this case, the description of the topic 1 comment was always on top for SEO.

@alexas,

If you just need to keep the first post (topic first post) on top of the topic on all pages you can enable the corresponding option in Dashboard > Forums > Settings > Topics & Posts Tab. You can enable it for each forum layout separately:

 

As per the hook for sorting replies, it comes very soon. Probably tomorrow.

2 Replies
alexas
(@alexas)
Joined: 5 years ago

Eminent Member
Posts: 34

Yes, the hook is needed, I can't wait until tomorrow. Martin you are the best!!!

ytonline
(@ytonline)
Joined: 1 year ago

New Member
Posts: 1

Thank you.

Robert
Posts: 9373
Admin
(@robert)
Support Team
Joined: 6 years ago

@alexas,

You don't have to wait for the next version release. You can add the exact same hook in the same location manually. Once the update is released, you can update without any issue.

Open this file:

wp-content/plugins/wpforo/wpforo.php

 

Find this line:

if( $this->post->get_option_union_first_post($current_object['layout']) ) $args['union_first_post'] = true;
$current_object['posts'] = $this->post->get_posts( $args, $current_object['items_count']);

 

And add the extra "hook line" between them like this:

if( $this->post->get_option_union_first_post($current_object['layout']) ) $args['union_first_post'] = true;
$args = apply_filters('wpforo_post_list_args', $args);
$current_object['posts'] = $this->post->get_posts( $args, $current_object['items_count']);

 

Then add the updated code for reversing replies order:

https://wpforo.com/community/how-to-and-troubleshooting-2/how-to-sort-posts-in-a-thread-oldest-first/#post-15418

Page 1 / 2
Share: