Title: Problem replacing classic widget with shortcode
Last modified: January 5, 2024

---

# Problem replacing classic widget with shortcode

 *  Resolved [arminh](https://wordpress.org/support/users/arminh/)
 * (@arminh)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/problem-replacing-classic-widget-with-shortcode/)
 * Hi, 
   to manage a greater updating project I’d duplicated an existing site and
   beneath other smaller issues I discovered, that I have to leave the wpp classic
   widget by replacing it with a shortcode solution. This has worked but unfortunately
   the “old” widget is counting all views (of the last 180 days) while the shortcode
   version counts only the views of the time since having duplicated the site (see
   website link, first the classic widget, beneath then the shortcode element). 
   Any idea why? In both elements there are the same setting (last 180 days). And
   the wpp dashboard of the duplicated site is showing the “old” views, too. But
   not the shortcode, here it is:
 * [wpp header=’Beliebt’ range=’last180days’ limit=3 freshness=0 stats_views=1 order_by
   =’views’ thumbnail_width=75 thumbnail_height=75 post_type=’blogbeitraege’ excerpt_length
   =55 post_html='{thumb} {title} {excerpt}{views_copy} | {date_copy}’ stats_date
   =1 stats_date_format=’d.m.Y’]
 * I would be glad to be able to change the classic widget right now while updating
   the site, but if there’s no solution I have to use classic widget as long as 
   possible.
 * Thank you in advance
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fproblem-replacing-classic-widget-with-shortcode%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/problem-replacing-classic-widget-with-shortcode/#post-17321349)
 * Hi [@arminh](https://wordpress.org/support/users/arminh/),
 * ‘last180days’ isn’t really a valid value for the _range_ parameter 😛 Said parameter
   will default to ‘last24hours’ if you pass a value that’s not within the expected
   ones: **last24hours**, **last7days**, **last30days**, **all**, or **custom**.
 * Since you want to use a _custom_ time range you need to use **custom** instead
   and also set the _time\_quantity_ and _time\_unit_ parameters (see [Parameters](https://github.com/cabrerahector/wordpress-popular-posts/wiki/2.-Template-tags#parameters))
   to specify the actual time range, like so:
 *     ```wp-block-code
       [wpp header='Beliebt' range='custom' time_quantity=180 time_unit='day' limit=3 freshness=0 stats_views=1 order_by='views' thumbnail_width=75 thumbnail_height=75 post_type='blogbeitraeg' excerpt_length=55 post_html='{thumb} {title} {excerpt}{views_copy} | {date_copy}' stats_date=1 stats_date_format='d.m.Y']
       ```
   
 *  Thread Starter [arminh](https://wordpress.org/support/users/arminh/)
 * (@arminh)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/problem-replacing-classic-widget-with-shortcode/#post-17321413)
 * Hi Hector,
   thank you for your very fast reply – I did’t think of the fact, that
   the 180 within the argument can’t be a parameter 🙁 But fine, so the issue turned
   out to be none 🙂
 * Thank you again for your support
   Armin

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

The topic ‘Problem replacing classic widget with shortcode’ 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/)

 * 2 replies
 * 2 participants
 * Last reply from: [arminh](https://wordpress.org/support/users/arminh/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/problem-replacing-classic-widget-with-shortcode/#post-17321413)
 * Status: resolved