Hi @conimoss,
The range parameter only accepts the following values (as described in Settings > WordPress Popular Posts > Parameters):
- last24hours
- last7days
- last30days
- all
- custom
If you want to use a custom time range you’ll need to set range as custom and use time_quantity and time_unit to set your custom time interval.
For example:
<?php
$args = array(
'range' => 'custom',
'time_quantity' => 1,
'time_unit' => 'hour'
);
wpp_get_mostpopular($args);
?>
thanks a lot.
It worked exactly as I wanted.
-
This reply was modified 5 years, 1 month ago by
ConiMoss.
-
This reply was modified 5 years, 1 month ago by
ConiMoss.
-
This reply was modified 5 years, 1 month ago by
ConiMoss.
(@conimoss)
5 years, 1 month ago
So I have been playing with the plugin for the last few days, but somehow I couldn’t get the range to show older than ‘last24hours’.
I have tried:
‘range’ => ‘last2days’,
‘range’ => ‘last60days’,
‘range’ => ‘last2months’,
‘range’ => ‘last6months’,
‘range’ => ‘last1year’,
nothing hapeens.
Is there any possible list of ranges available for most commented posts?
I’m currently using this code:
<?php
$args = array(
‘limit’ => 6,
‘range’ => ‘last24hours’,
‘order_by’ => ‘comments’,
‘stats_views’ => 0
);
wpp_get_mostpopular($args);
?>