title: Query Jetpack Wordpress Stats List
body: <p>I want to show the most viewed post from the week in a widget.</p>
  
  <pre><code>&lt;?php
  
  function filter_where($where = '') {
      //posts in the last 30 days
      $where .= " AND post_date &gt; '" . date('Y-m-d', strtotime('-30 days')) . "'";
      return $where;
  }
  add_filter('posts_where', 'filter_where');
  
  query_posts('post_type=post&amp;posts_per_page=4&amp;orderby=rand&amp;order=DESC');
  
  while (have_posts()): the_post(); ?&gt;
  
  &lt;li style="
      margin-bottom: 5px;
      background: transparent url(http://i.imgur.com/6ngfnNo.png) repeat scroll center top;
      padding: 15px;
      list-style-type: none;
      width: 500px;
      margin: 10px 0px 0px 10px;
  "&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;" title="&lt;?php printf(esc_attr('Permalink to %s'), the_title_attribute('echo=0')); ?&gt;" rel="bookmark"&gt;&lt;span class="tptn_title" style="
      color: #fff;
      text-transform: uppercase;
      font-family: 'Montserrat-Bold', sans-serif;
  "&gt;&lt;?php the_title(); ?&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
  
  &lt;?php
  endwhile;
  wp_reset_query();
  ?&gt;
  </code></pre>
  
  <p>I'm using this one, because Jetpack doesn't allow me to query the most viewed post.</p>