Random posts filter (add new filter or alter existing)

Posted in: Newspaper
Post count: 40

I would like to have a filter like; “Random posts from last 30 days” instead of actual one of 7 days.
Is it possible to add a filter or modify the days of present filter?
Thanks

Post count: 20685

Hi,

There’s no such sorting method unfortunately.

You could modify the 7 days filter, it’s in this file -> wp-content\plugins\td-composer\legacy\common\wp_booster\td_data_source.php

If you search in that file there will be a section like this -> https://prnt.sc/uOluDxQiHdJj
Then change the “1 week ago” to for example “30 days ago”. I believe it should work, the block should then display random posts from the last 30 days.

I’m sorry for the inconvenience.

Thank you!

Post count: 40

Thanks for the answer.
After that change the block should display random posts from the last 30 days but the name of the filter remains “Random posts from the last 7 days”. Is it correct in your opinion?

Post count: 20685

That modification changes the sorting method functionality, not it’s name, the name is set elsewhere. The name is unimportant however. After making the modification the block should display posts from the last 30 days instead of 7 days.

Thank you!

Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.