Home User profile
tagDiv Member
This user did not write anything. So we are just showing here some random text to make the profile page look nice :)
17seconds
tagDiv Member

For anyone else looking for the same function, and I have seen quite a few people ask for this, here is how I solved it.
It is a workaround, and if someone can offer an improvement on this solution, please paste your code below.

Copy td_data_source.php from the parent theme and paste to:
/wp-content/themes/Newspaper-child/includes/wp_booster/td_data_source.php

I decided I am probably never going to use the Sort Alphabetically option for my td composer widgets. So, I updated the args array for Sort Alphabetical to suit my purposes.

Comment out the normal alphabetical order and use the new code below.

// case ‘alphabetical_order’:
// $wp_query_args[‘orderby’] = ‘title’;
// $wp_query_args[‘order’] = ‘ASC’;
// break;
case ‘alphabetical_order’: //Limit to last 10 days
$wp_query_args[‘date_query’] = array(
‘after’ => date(‘Y-m-d’, strtotime(‘-10 days’))
);
break;

@ the theme developers: Please can this can go on the wishlist and be included in a future version.
The amount of days should be a selectable field in the widget option.

17seconds
tagDiv Member

Hi Vlad

Thank you for your reply. I do not want random posts or only popular posts.
I want to return ALL posts for the last 7 days sorted by date desc.

  • This reply was modified 7 years by 17seconds.
Viewing 2 posts - 1 through 2 (of 2 total)