• Resolved ConiMoss

    (@conimoss)


    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);
    ?>

    • This topic was modified 3 years, 8 months ago by ConiMoss.
    • This topic was modified 3 years, 8 months ago by ConiMoss.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    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);
    ?>
    Thread Starter ConiMoss

    (@conimoss)

    thanks a lot.

    It worked exactly as I wanted.

    • This reply was modified 3 years, 8 months ago by ConiMoss.
    • This reply was modified 3 years, 8 months ago by ConiMoss.
    • This reply was modified 3 years, 8 months ago by ConiMoss.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Range Last 31 days, last 6months, all time?’ is closed to new replies.