Title: Custom Time Range
Last modified: April 24, 2018

---

# Custom Time Range

 *  Resolved [bsilent](https://wordpress.org/support/users/bsilent/)
 * (@bsilent)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/custom-time-range/)
 * Hello,
 * Thank you for your hard work on this widget.
 * I’m having trouble with the custom time range.
 * I would like the popular posts widget to display posts up to a year back.
 * I’ve tried changing the custom time range to 365 days but I still don’t get the
   right posts.
 * Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/custom-time-range/#post-10214505)
 * Hi [@bsilent](https://wordpress.org/support/users/bsilent/),
 * What do you mean with “the right posts”? What’s the expected output and what 
   are you seeing instead?
 * Also, how long has WPP been installed on your site?
 *  Thread Starter [bsilent](https://wordpress.org/support/users/bsilent/)
 * (@bsilent)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/custom-time-range/#post-10221968)
 * Hello Sir,
 * I’m trying to have the popular posts return the most popular posts within a year
   by most views. I see the drop down minutes hours and days so I selected days 
   and inserted 365 for the days but they dont match the same posts as the ones 
   that my site stats say are the most popular. It does however work when I change
   the drop down to 30 days but I’m trying to get it to return popular posts within
   a year. Thank you again for your help. Its been several months that WPP has been
   installed sir.
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/custom-time-range/#post-10222165)
 * > I’m trying to have the popular posts return the most popular posts within a
   > year by most views.
 * I’m sorry but that’s not how the Tame Range feature works.
 * The Time Range feature retrieves the most viewed / commented posts from the current
   date & time to _N_ days back.
 * This means, in your case, that WPP will obtain the most viewed / commented posts
   from **2018-04-20 12:37:25** to **2017-04-20 12:37:25** (365 days from the current
   date & time).
 * It is possible to display only the most viewed posts from this year, but you’ll
   have to code a bit. See the [WPP_Query class](https://github.com/cabrerahector/wordpress-popular-posts/blob/master/includes/class-wordpress-popular-posts-query.php)
   and the hooks in it for more details.
 * **P.S.:** If you don’t know how to code / don’t have the time for it, [I’m available for freelance work](https://cabrerahector.com/about/#say-hi).
 *  Thread Starter [bsilent](https://wordpress.org/support/users/bsilent/)
 * (@bsilent)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/custom-time-range/#post-10222769)
 * Thank you very much sir. I did add the [wpp range=’custom’ time_quantity=1 time_unit
   =’year’] but ran into a little bit of trouble trying to exclude some posts I 
   tried to add [wpp pid=’60,25,31′] like this [wpp pid=’60,25,31′ range=’custom’
   time_quantity=1 time_unit=’year’] but was unsuccessful. I was wondering if you
   could tell me what I’m doing wrong. Again thank you very much for your time and
   effort. It is greatly appreciated.
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/custom-time-range/#post-10232307)
 * Hi [@bsilent](https://wordpress.org/support/users/bsilent/),
 * `year` isn’t valid value. The ones the `time_unit` parameter accepts as valid
   are `minute`, `hour`, `day`, `week` or `month`. Here’s the equivalent:
 * `[wpp pid='60,25,31' range='custom' time_quantity=365 time_unit='day']`
 *  Thread Starter [bsilent](https://wordpress.org/support/users/bsilent/)
 * (@bsilent)
 * [8 years ago](https://wordpress.org/support/topic/custom-time-range/#post-10239565)
 * Thank you for your help sir. I really appreciate it.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Custom Time Range’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-popular-posts/assets/icon-256x256.png?rev=1232659)
 * [WP Popular Posts](https://wordpress.org/plugins/wordpress-popular-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-popular-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-popular-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-popular-posts/reviews/)

## Tags

 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [time range](https://wordpress.org/support/topic-tag/time-range/)

 * 6 replies
 * 2 participants
 * Last reply from: [bsilent](https://wordpress.org/support/users/bsilent/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/custom-time-range/#post-10239565)
 * Status: resolved