Postviews and Postratings in last X days/months
-
Hi.
I have this code to show my posts from category by postviews:
<?php $oddpost = 'alt-post'; $postcount = 1; query_posts('category_name=movies&v_sortby=views&v_orderby=desc'); if (have_posts()) : while (have_posts()) : the_post(); ?>
I have this one for post ratings:
<?php $oddpost = 'alt-post'; $postcount = 1; query_posts('category_name=movies&v_sortby=views&v_orderby=desc'); if (have_posts()) : while (have_posts()) : the_post(); ?>
Both working good, but also working for “All Time Stats”, and that is problem now.
I want to make this query updating per week or at least per month.I tried:
<php $week = date('W'); ?> <php $year = date('Y'); ?> <?php $oddpost = 'alt-post'; $postcount = 1; query_posts('category_name=movies&v_sortby=views&v_orderby=desc&year=' . $year . '&w=' . $week); if (have_posts()) : while (have_posts()) : the_post(); ?>
But this did not worked.
Can anyone give me any solutions.
If I can’t make query with ratings, at least somehow to make query of my posts by views in last week or month.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Postviews and Postratings in last X days/months’ is closed to new replies.