popular post weekly and monthly
i want to display popular posts for 1 week ago and 1 month ago.these are codes that i used but these don't work correctly for 1 week ago
ul
?php
$week = date('W');
$year = date('Y');
query_posts('meta_key=post_views_countcat='.$link1.'posts_per_page=9orderby=meta_value_numorder=DESCyear=' . $year . 'weeknum=' . $week);
while (have_posts()): the_post(); ?
li
h2a href="?php the_permalink(); ?" target="_blank"?php the_title(); ?/a/h2
div style="display:?php echo $display;?" class="tooltiptext hidden-xs"?php the_excerpt(); ?/div
/li
?php
endwhile;
wp_reset_query();
?
/ul
for 1 month ago
ul
?php
$month = date('m');
$year = date('Y');
query_posts('meta_key=post_views_countcat='.$link1.'posts_per_page=9orderby=meta_value_numorder=DESCyear=' . $year . 'monthnum=' . $month);
while (have_posts()): the_post(); ?
li
h2a href="?php the_permalink(); ?" target="_blank"?php the_title(); ?/a/h2
div style="display:?php echo $display;?" class="tooltiptext hidden-xs"?php the_excerpt(); ?/div
/li
?php
endwhile;
wp_reset_query();
?
/ul
Topic popular-posts loop query-posts Wordpress
Category Web