Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'date_query' => array(
- 'relation' => 'OR',
- array(
- 'column' => 'post_date',
- 'after' => '-7 days'
- ),
- array(
- 'column' => 'post_modified',
- 'after' => '-7 days'
- )
- )
- //order home posts by modified
- function order_home_asc($query) {
- if ($query->is_home() && $query->is_main_query() && !is_admin()) {
- $query->set('orderby', 'modified');
- $query->set('order', 'DESC');
- $query->set( 'post__not_in', array( 889, 738, 1008, 808, 638) );
- $query->set('post_status', 'future,publish');
- }
- }
- add_action('pre_get_posts', 'order_home_asc');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement