Random post in widget from last 1 year

Posted in: Newspaper
Post count: 268

Hi

I’d like to know how change code to sort the random posts in widget
from last year instead of ever or last 7 days…

thanks

Post count: 23312

Hello Bintmusic,

Unfortunately, this is not a simple task and we do not have a quick solution for this because is required to overwrite the whole function wich do this feature and this thing is custom work. If you are not aware how to achieve this, please consider hiring a freelancer/developer to do this for you because we cannot provide custom work at the moment, sorry!

Thank your for the message and thank you for your understanding!

Post count: 268

hi catalin

previus version was enought modify

case ‘random_7_day’:
$wp_query_args[‘orderby’] = ‘rand’;
$wp_query_args[‘date_query’] = array(
‘column’ => ‘post_date_gmt’,
‘after’ => ‘1 week ago’);

in Newspaper\includes\wp_booster\td_data_source.php

really now it has become impossible?

Thanks!

Post count: 23312

Hello Bintmusic,

Please notice that is not a simple task but is not impossible. If you want to have this feature from last year instead 7 days, you should do another case in td_data_source.php -> http://screencast.com/t/huzoSx9d For more information about wp_query, please check this documentation and try to implement this using the information from here -> https://codex.wordpress.org/Class_Reference/WP_Query -> http://screencast.com/t/FZP1iVky3Ei
If you are not aware the steps wich will follow in this regard and if you want to display more levels you need custom modifications and I suggest to hire a freelancer to do this for you as we cannot provide custom work at this time, sorry!

Hope this helps!

Thank you for the message!

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