Title: Sidebar widget works, shortcode doesn&#8217;t
Last modified: March 27, 2020

---

# Sidebar widget works, shortcode doesn’t

 *  Resolved [lieska](https://wordpress.org/support/users/lieska/)
 * (@lieska)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/sidebar-widget-works-shortcode-doesnt/)
 * Hi, this is a great plugin, but for some reason I just can’t get the shortcode
   show anything but “Sorry. No data so far.” No cache plugin at the moment and 
   I’ve tried different settings in Tools/Data. In example page the non-working 
   shortcode is in content area and working widget in sidebar. I added also the 
   shortcode to the sidebar, it’s not working there either.
 * The shortcode is default example (I’ve tried different settings, no help)
    [wpp
   range=”last1days” limit=5 stats_views=1 order_by=”views”]
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fsidebar-widget-works-shortcode-doesnt%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/sidebar-widget-works-shortcode-doesnt/#post-12591758)
 * Hi [@lieska](https://wordpress.org/support/users/lieska/),
 * `last1days` is not a valid value for the `range` parameter (see **Settings > 
   WordPress Popular Posts > Parameters** for more details.)
 * If you want to show the most viewed posts from the last 24 hours, try this instead:
 * `[wpp range='last24hours' limit=5 stats_views=1 order_by='views']`
 *  Thread Starter [lieska](https://wordpress.org/support/users/lieska/)
 * (@lieska)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/sidebar-widget-works-shortcode-doesnt/#post-12592074)
 * Hi Héctor, yeah ok, that was just one of my tests. Anyway any value there doesn’t
   work.
 * Now I have in sidebar shortcode [wpp range=’last24hours’ limit=5 stats_views=
   1 order_by=’views’]
    Same result.
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/sidebar-widget-works-shortcode-doesnt/#post-12592348)
 * Try pasting that shortcode into an actual WP page and see if the issue persists
   or not. If it works on a page but not on the widget then the widget is what’s
   causing the problem.
 *  Thread Starter [lieska](https://wordpress.org/support/users/lieska/)
 * (@lieska)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/sidebar-widget-works-shortcode-doesnt/#post-12592381)
 * It is in the home page also where there is no sidebar, not working there either.(
   It’s under TOP30 heading.)
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/sidebar-widget-works-shortcode-doesnt/#post-12592707)
 * How odd. Is the widget also configured to show the top viewed posts from the 
   last 24 hours? Also, which editor are you using on your site?
 *  Thread Starter [lieska](https://wordpress.org/support/users/lieska/)
 * (@lieska)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/sidebar-widget-works-shortcode-doesnt/#post-12592812)
 * Yes, now it is. But as I told, I’ve tried different settings, shortcode doesn’t
   work, widget does. I have Astra theme with Gutenberg editor.
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/sidebar-widget-works-shortcode-doesnt/#post-12592843)
 * Alright, I’ve tested the shortcode with Gutenberg before and as far as I know
   it worked normally but I’ll give it another test as soon as I can and post back
   my results here.
    -  This reply was modified 6 years, 2 months ago by [Hector Cabrera](https://wordpress.org/support/users/hcabrera/).
      Reason: Fixed typo
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/sidebar-widget-works-shortcode-doesnt/#post-12599681)
 * Hi [@lieska](https://wordpress.org/support/users/lieska/),
 * So I tried adding the WPP shortcode to a post via the Gutenberg editor and everything
   worked as expected:
 * ![WPP shortcode in Gutenberg's editor via the shortcode block](https://i0.wp.
   com/i.postimg.cc/HWX0tPg7/wpp-shortcode-on-gutenberg-editor.jpg?ssl=1)
 * ![WPP widget settings](https://i0.wp.com/i.postimg.cc/0Nv1b4Pd/wpp-widget-settings.
   jpg?ssl=1)
 * ![Homepage displaying both the shortcode and the widget as expected](https://
   i0.wp.com/i.postimg.cc/kXypT5m8/homepage.jpg?ssl=1)
 * This was with the Twenty Twenty theme (included by default with WordPress now.)
 *  Thread Starter [lieska](https://wordpress.org/support/users/lieska/)
 * (@lieska)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/sidebar-widget-works-shortcode-doesnt/#post-12607797)
 * Hi Héctor. I tried the default (same) theme as you, no change. I also disabled
   all the other plugins, no help. This is really really strange.
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/sidebar-widget-works-shortcode-doesnt/#post-12607825)
 * No idea then, unfortunately. The problem is likely being caused by something 
   on your side, as shown before I wasn’t able to reproduce it on a clean WP install.
   You’ll need to figure out what that _something_ is so I may be able to help out.
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/sidebar-widget-works-shortcode-doesnt/#post-12642964)
 * Marking as **resolved** due to inactivity.

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

The topic ‘Sidebar widget works, shortcode doesn’t’ 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

 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 11 replies
 * 2 participants
 * Last reply from: [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/sidebar-widget-works-shortcode-doesnt/#post-12642964)
 * Status: resolved