Hi everyone, I'm trying to display popular posts sort by Day, Week, Month and All using this SNIPPET This is the query I'm using to display the popular posts. For Monthly <ul> <?php $month = date('m'); $year = date('Y'); query_posts('meta_key=post_views_count&orderby=meta_value_num&order=DESC&year=' . $year . '&monthnum=' . $month); while (have_posts()): the_post(); ?> <li><a>" title="<?php printf(esc_attr('Permalink to %s'), the_title_attribute('echo=0')); ?>" rel="bookmark"><?php the_title(); ?></a></li> <?php endwhile; wp_reset_query(); ?> </ul> PHP: This will display All Time Popular Posts <ul> <? query_posts('meta_key=post_views_count&orderby=meta_value_num&order=DESC'); while (have_posts()): the_post(); ?> <li><a href="<?php the_permalink(); ?>" title="<?php printf(esc_attr('Permalink to %s'), the_title_attribute('echo=0')); ?>" rel="bookmark"><?php the_title(); ?></a></li> <?php endwhile; wp_reset_query(); ?> </ul> PHP: Both the above codes are working but I don't know how to display popular posts for Day and weekly?
Hello i think this link http://www.wpbeginner.com/wp-tutorials/display-popular-posts-by-day-week-month-and-all-time-in-wordpress/ will help you. Here is an clear description to Display Popular Posts by Day, Week, Month, and All Time in WordPress.
Thank you but that link doesn't help me a lot because I'm trying to add this function manually and the guide you show me is about the plugin. I just need a query to call using this function.