title: Wordpress : Most populars posts of the Week or Month
body: <p>I'm using a theme that shows popular posts with the code below, and I need
  someone to help me edit this code to make it show popular posts on the last week or 
  month.</p>
  
  <pre><code>&lt;?php 
                  $args = array();
                  $args['posts_per_page'] = $number_posts;
                  $args['orderby'] = 'comment_count';
                  $args['order'] = 'DESC';
                  $query = new WP_Query($args);
                  while($query-&gt;have_posts() ) : $query-&gt;the_post(); global $post; ?&gt;
                      &lt;li&gt;
                          &lt;a title="&lt;?php the_title();?&gt;" href="&lt;?php the_permalink();?&gt;"&gt;
                              &lt;figure&gt;
                                  &lt;?php if(has_post_thumbnail() ) { ?&gt;
                                      &lt;a href="&lt;?php the_permalink();?&gt;"&gt;
                                          &lt;img src="&lt;?php echo aq_resize(wp_get_attachment_url( get_post_thumbnail_id($post-&gt;ID) ), 42, 42, true); ?&gt;" alt="&lt;?php the_title();?&gt;" /&gt;
                                      &lt;/a&gt;
                                  &lt;?php } else { ?&gt;
                                      &lt;a href="&lt;?php the_permalink();?&gt;"&gt;
                                          &lt;img src="&lt;?php echo get_template_directory_uri() . '/img/missing_56.png';?&gt;" alt="&lt;?php the_title();?&gt;" /&gt;
                                      &lt;/a&gt;
                                  &lt;?php } ?&gt;
                              &lt;/figure&gt;
                              &lt;p&gt;
                                  &lt;a href="&lt;?php the_permalink();?&gt;"&gt;&lt;?php the_title();?&gt;&lt;/a&gt; &lt;br /&gt; 
                                  &lt;span&gt; &lt;?php _e('Le ', 'Voxis'); the_time("F d, Y");?&gt;, &lt;?php comments_popup_link(esc_html__('0 commentaires','Voxis'), esc_html__('1 commentaire','Voxis'), '% '.esc_html__('commentaires','Voxis')); ?&gt; &lt;/span&gt;
                              &lt;/p&gt;
                          &lt;/a&gt;
                      &lt;/li&gt;
                  &lt;?php endwhile; wp_reset_postdata(); ?&gt;
              &lt;/ul&gt;
  </code></pre>