Support » Plugin: WordPress Popular Posts » Time Range Issue

  • Resolved Nbrubaker



    Good work on this plugin. Would you please show me how I can modify the code to allow me to display posts from the last 60 or even 90 days in the widget? For our posting frequency at the moment 30 days is too short and all-time is too long.

    I appreciate it!


Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Héctor Cabrera


    Hi Nick!

    The part of the code that handles the time range is this one.

    A quick & dirty way to achieve what you need would be by changing one of the switch-case statements to something like:

    case "weekly":
        $where .= " AND p.post_date > DATE_SUB('{$now}', INTERVAL 60 DAY) ";

    … and then set Time Range to “last 7 days”.

    The problem with this approach is that you’ll have to redo this modification to the plugin each time it gets updated (a few times per year).

    … or you could just wait until I’m done working on WPP 4.0 which among other features will allow you to set a custom Time Range without having to tinker with code.

    Thank you for the fix, Hector! I’m looking forward to WPP4.0 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Time Range Issue’ is closed to new replies.