(PHP) wp_question get posts from previous 30 times, purchase by views

I use this code to get the every month most viewed posts:

`$a single_month_ago = time()-(60*60*24*31)`
`$args = array(`
`’posts_for each_page’ => ‘100’,`
`’date_query’     => array(`
`’after’ => array(`
`’year’  => date(‘Y’,$1_month_back),`
`’month’ => date(‘m’,$1_thirty day period_in the past),`
`’day’   => date(‘d’,$a single_month_ago),`

But I won’t be able to get it to incorporate posts that were posted in the last 30 times. What is mistaken with my query?

Leave a Reply

Your email address will not be published.