Custom Article Sort Order preferring Virality

Posted in: Newspaper
Post count: 51

Hey TagDiv Team, Hey Everyone

I’d like to implement a custom article sort order. I’d like to sort articles with an preference to current and viral articles with some kind of randomness. I extended the post table with an column for some kind of virality index (higher = better). Now I’d like to have a custom sort function e.g. ORDER BY (post_viralityindex * post_age * rand() ).

I know how to change sorting in td_module_blog. However the only thing possible is 'orderby' => 'rand'.

Does anyone know a smart way to integrate this without having to change wp core files?

Thx, I really appreciate your expertise

Best regards from Germany,

Manuel

  • This topic was modified 12 years by Manuel Fink. Reason: typo
Post count: 263

@Manuel, is the orderby = rand working for you for the Similar Articles below the post area? I am using 4.0.2 and its not randomizing any of them but only showing the latest articles. It did work in previous versions.

Post count: 51

@sbo, definitely working. Did you bear in mind that you have to update all files after a theme update?

Post count: 6600

Hi,

Works using 'sort' => 'random_posts' see here

Thanks

Post count: 51

@Lucian: How can I implement an own sorting order with random_posts? I think you answered sbo and not to my original question?

Post count: 854

hi,
all the sorting for posts in modules are happening here : http://screencast.com/t/0ELDdR7y0qZR . change the value of the ‘orderby’ .

Thanks for you message.
Radu A.

Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Newspaper’ is closed to new topics and replies.