title: I want to display (the most popular posts for today) in wordpress and this list should be updated automatically every day
body: <p>I did display the most popular posts in my website using a function but the problem is that this function display the most popular posts for all time and I don't want this.</p>
  
  <p>I want to display (the most popular posts for today)and this list should be updated automatically every day.</p>
  
  <p>Note that I don't want to use plugins</p>
  
  <p>THis is in functions.php </p>
  
  <pre><code>&lt;?php //fucntion to sort posts bade in thier views.
  $args_views = array(  'posts_per_page'  =&gt; 6,  /* get 4 posts, or set -1 for all */
                  'orderby'      =&gt; 'meta_value',  /* this will look at the meta_key you set below */
                  'meta_key'     =&gt; 'post_views_count',
                  'order'        =&gt; 'DESC',
                  'post_type'    =&gt; 'post',
                  'post_status'  =&gt; 'publish'
              );
  $myposts = get_posts( $args );
  foreach( $myposts as $mypost ) {
      /* do things here */
  }
  ?&gt;
  </code></pre>
  
  <p>and this is my query in index.php</p>
  
  <pre><code>&lt;div class="container"&gt;
      &lt;?php query_posts($args_views);?&gt;
              &lt;?php while ( have_posts() ) : the_post(); ?&gt;
              &lt;div id="archive-thumbnail" class="thumbnail"&gt;
                  &lt;div class=" &lt;?php if ( has_catch_that_image() ) { ?&gt;archive-body &lt;?php } ?&gt;"&gt;
                    &lt;div id="archive-img"&gt;&lt;img class="media-object-sp" src="&lt;?php echo has_catch_that_image(); ?&gt;" alt="..."&gt;&lt;/div&gt;
                    &lt;h4 id="archive-thumbnail-title" style="color:#337ab7;"&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt; &lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h4&gt;
                    &lt;p id="archive-thumbnail-excerpt"&gt;&lt;?php the_excerpt();?&gt;&lt;/p&gt;
                    &lt;p class="text-muted"&gt; by: &lt;?php the_author(); ?&gt; | before&lt;?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ''; ?&gt;&lt;/p&gt;&lt;/div&gt;
  
              &lt;/div&gt;
              &lt;?php endwhile; ?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and this is in Snigle.php </p>
  
  <pre><code>    &lt;?php // this is to count the views
   setPostViews(get_the_ID()); ?&gt;
  </code></pre>