AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

[Solved] I want my topics to show " latest reply to oldest reply"

12 Posts
5 Users
9 Reactions
6,560 Views
Posts: 7
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@om-vitalii)
Active Member
Joined: 6 years ago
[#15338]

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


11 Replies
2 Replies
Robert
Admin
(@robert)
Joined: 3 months ago

Support Team
Posts: 10741
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

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


(@om-vitalii)
Joined: 6 years ago

Active Member
Posts: 7
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

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

 Screenshot 2020 12 11 at 01.53.55

Robert
Posts: 10741
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@robert)
Support Team
Joined: 3 months 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
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@alexas)
Eminent Member
Joined: 9 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


Posts: 1001
Moderator
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@martin)
Support Team
Joined: 10 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: 9 years ago

Eminent Member
Posts: 34
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

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


ytonline
(@ytonline)
Joined: 5 years ago

New Member
Posts: 1
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

Thank you.


Robert
Posts: 10741
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@robert)
Support Team
Joined: 3 months 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: