fahad_abdullah

Untitled

Jan 27th, 2021
808
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $arguments = array(
  2.             'post_type'      =>  'post',
  3.             'posts_per_page' =>  5,
  4.             'date_query' => array(
  5.                 'after' => '2 months ago',
  6.             ),
  7.             'meta_query'    => array(
  8.                 'key'       => '_post_views_count'
  9.             ),
  10.             'meta_key'     => '_post_views_count',
  11.             'orderby'        => 'meta_value_num',
  12.             'order'          => 'DESC',
  13.             'post_status'    => 'publish'
  14.         );
  15.  
  16.         $popular_posts = new WP_Query ( $arguments );
RAW Paste Data