0
Ich möchte den am meisten angesehenen Beitrag der Woche in einem Widget anzeigen.Abfrage Jetpack WORPRESS Stats Liste
<?php
function filter_where($where = '') {
//posts in the last 30 days
$where .= " AND post_date > '" . date('Y-m-d', strtotime('-30 days')) . "'";
return $where;
}
add_filter('posts_where', 'filter_where');
query_posts('post_type=post&posts_per_page=4&orderby=rand&order=DESC');
while (have_posts()): the_post(); ?>
<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;
"><a href="<?php the_permalink(); ?>" title="<?php printf(esc_attr('Permalink to %s'), the_title_attribute('echo=0')); ?>" rel="bookmark"><span class="tptn_title" style="
color: #fff;
text-transform: uppercase;
font-family: 'Montserrat-Bold', sans-serif;
"><?php the_title(); ?></span></a></li>
<?php
endwhile;
wp_reset_query();
?>
Ich benutze dieses, weil Jetpack nicht erlaubt, den am meisten angesehenen Beitrag abzufragen. Kann mir jemand helfen?