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

[Closed] Sort Postings, links not working anymore

10 Posts
2 Users
0 Reactions
3,138 Views
Posts: 19
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
(@seofoxx-de)
Eminent Member
Joined: 3 years ago
[#49393]

I used the following code to change the sort oder of replies. So new postings at the top.

But now the links of recent posts are not working correct anymore, so they donest redirect to the correct post anymore. But this only happens to "direct replies"

 

This is my code

add_filter('wpforo_post_list_args', function ($args){
if(!empty($args)){
$args['orderby'] = '`is_first_post` DESC, `created` DESC, `postid` DESC';
}
return $args;
});

 

Any idea why this also have an impact to these links?


9 Replies
Chris
Posts: 3609
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
(@chris)
Famed Member
Joined: 5 years ago

Hi @seofoxx-de,

The code you wrote won't do what you're looking for. There is no way to do that.


1 Reply
Chris
(@chris)
Joined: 5 years ago

Famed Member
Posts: 3609
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

@seofoxx-de,

Using this code, you can show replies/posts in reversed order. So the new replies will be on the top, right after the first post of the topic. You should put this code to the current active WordPress theme functions.php file:

add_filter('wpforo_post_list_args', function ($args){
if(!empty($args)){
$args['orderby'] = '`is_first_post` DESC, `created` DESC, `postid` DESC';
}
return $args;
});

Posts: 19
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
(@seofoxx-de)
Eminent Member
Joined: 3 years ago

Im confused -  this code was presented from you? https://wpforo.com/community/postid/15418/ and it works, so it does change the sort order. 


Posts: 19
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
(@seofoxx-de)
Eminent Member
Joined: 3 years ago

ok maybe i misunderstood your answer, so this code change the sort order ok - but you say its not possible to get the "recent posts" links (right sidebar) to work ?


1 Reply
Chris
(@chris)
Joined: 5 years ago

Famed Member
Posts: 3609
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

@seofoxx-de,

The code I provided won't affect on the sidebar. It would just reverse the posts, so new at start, old at the end.


Posts: 19
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
(@seofoxx-de)
Eminent Member
Joined: 3 years ago

Ok yes, and i dont want to change the sort order at the sidebar, thats not what i meant. I just talk about the issue when implementing this code - these "last replies" donest work anymore - so they dont redirect to the posting - they just open the thread at the very first post.


1 Reply
Chris
(@chris)
Joined: 5 years ago

Famed Member
Posts: 3609
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

@seofoxx-de,

Ok, got you, Sorry for the Misunderstanding.

I have sent this to our Dev for a test. Will let you know what we got.


Page 1 / 2
Share: