Get popular post in a week

I am still struggling to get this code work…please anyone can help?

<?php
query_posts('meta_key=post_views_count&orderby=meta_value_num&order=DESC&posts_per_page=2');
if (have_posts()) : while (have_posts()) : the_post();
?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php
endwhile; endif;
wp_reset_query();
?>

The code above gets popular post of all time but I just want to limit it to popular post in a week. Thanks

go into the function query_posts and alter it accordingly.

can you show me on how to do that?

I don’t know wordpress. I would recommend downloading the project and searching within the files, or having a look for an online documentation.

Sponsor our Newsletter | Privacy Policy | Terms of Service