Help required in Time Range
-
I am unable to get correct result according to time duration 1 day, 1 month or so on with the following.
$args = array(
‘post_type’ => ‘post’,
‘paged’ => $paged,
‘meta_key’ => ‘ratings_score’,
// ‘meta_key’ => ‘ratings_average’,
// ‘time_range’ => ‘2 months’,
// ‘timestamp’ => ‘1 day’,‘rating_timestamp’ => ‘1 day’,
‘cat’ => ‘15,14’,
// ‘highest_rated_range’ => ‘1 month’,
‘orderby’ => ‘meta_value_num’,
‘order’ => ‘DESC’
);does anybody can help me?
-
Sorry, you can’t do time range with query posts.
You have to use the limited function
get_highest_rated_range('1 day');Thank you Lester for faster reply. Can you add this functionality into future versions?
Unlikely it can be done because for time range, it has to scan through the logs of the ratings to calculate so it can’t be integrated to the query_posts which works on post and post meta
Thank you Lester for the help. Basically I have needed time range to be integrated into the query_posts to show all posts according to the different time ranges for multiple pages into my sites. Can you suggest me alternate solution to achieve this type of result if possible?
Sorry I don’t have an alternative solution.
What I can suggest is take a look at various filter to query_posts() like JOIN, http://codex.ww.wp.xz.cn/Plugin_API/Filter_Reference/posts_join to see whether you can join to the wp_ratings table via the post_id using WP_Query/query_posts.
The topic ‘Help required in Time Range’ is closed to new replies.