Notifications
Clear all

[Closed] Sort Postings, links not working anymore

10 Posts
2 Users
0 Reactions
978 Views
Posts: 16
Topic starter
(@seofoxx-de)
Eminent Member
Joined: 2 years ago

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: 3627
(@chris)
Famed Member
Joined: 3 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: 3 years ago

Famed Member
Posts: 3627

@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: 16
Topic starter
(@seofoxx-de)
Eminent Member
Joined: 2 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: 16
Topic starter
(@seofoxx-de)
Eminent Member
Joined: 2 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: 3 years ago

Famed Member
Posts: 3627

@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: 16
Topic starter
(@seofoxx-de)
Eminent Member
Joined: 2 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: 3 years ago

Famed Member
Posts: 3627

@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