Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. 'date_query' => array(
  2. 'relation' => 'OR',
  3. array(
  4. 'column' => 'post_date',
  5. 'after' => '-7 days'
  6. ),
  7. array(
  8. 'column' => 'post_modified',
  9. 'after' => '-7 days'
  10. )
  11. )
  12.  
  13. //order home posts by modified
  14. function order_home_asc($query) {
  15. if ($query->is_home() && $query->is_main_query() && !is_admin()) {
  16. $query->set('orderby', 'modified');
  17. $query->set('order', 'DESC');
  18. $query->set( 'post__not_in', array( 889, 738, 1008, 808, 638) );
  19. $query->set('post_status', 'future,publish');
  20. }
  21. }
  22. add_action('pre_get_posts', 'order_home_asc');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement