I am using this simple snippets to get post view count for a long time
I was wondering if we can add a “time” data ?
Because I would like to show the view of yesterday/ 2 days ago / 2 days ago etc… ?
we can display in sidebar like MOST POPULAR POSTS OF THE DAY, MONTH or HOURS (if possible)
here is my sidebar code
<?php query_posts('meta_key=post_views_count&orderby=meta_value_num&posts_per_page=4&order=DESC'); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php echo getPostViews(get_the_ID()); ?>
<a class="tab_caption" href="https://wordpress.stackexchange.com/questions/60034/<?php the_permalink(); ?>" title="<?php echo $post_title; ?>"><?php echo get_the_title($post->ID);?></a>
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_query(); ?>