Title: Create a shortcode to replace classic widget
Last modified: August 9, 2023

---

# Create a shortcode to replace classic widget

 *  Resolved [richesio](https://wordpress.org/support/users/richesio/)
 * (@richesio)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/create-a-shortcode-to-replace-classic-widget/)
 * Hi there,
 * We currently use the widget and we have the ‘The WordPress Popular Posts classic
   widget is going away’ message.
 * How would we create a shortcode to look and work like what we have already? I’ve
   included the link to what we have already.
 * Any help would be much appreciated.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcreate-a-shortcode-to-replace-classic-widget%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/create-a-shortcode-to-replace-classic-widget/#post-16959381)
 * Hi [@richesio](https://wordpress.org/support/users/richesio/),
 * Alright, please follow these instructions:
 * #1 Place a Text widget on your sidebar and set its title as _Trending_.
 * #2 Paste the following shortcode inside the Text widget and save changes.
 *     ```wp-block-code
       [wpp range='last24hours' post_type='post' thumbnail_width=484 thumbnail_height=272 wpp_start='<ul class="wpp-list wpp-list-with-thumbnails">' wpp_end='</ul>']
       ```
   
 * The only thing in there that you may want/need to adjust is the _range_ parameter
   so its value matches what you’re currently using with the widget (on the widget
   you’ll find it as _Time Range_). The _range_ parameter accepts the following 
   values: _last24hours_, _last7days_, _last30days_, _all_, _custom_ (see [Parameters](https://github.com/cabrerahector/wordpress-popular-posts/wiki/2.-Template-tags#parameters)
   for more details).
 * If you have any further comments/questions please let me know.
 *  Thread Starter [richesio](https://wordpress.org/support/users/richesio/)
 * (@richesio)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/create-a-shortcode-to-replace-classic-widget/#post-16959431)
 * Brilliant, thank you.
    -  This reply was modified 2 years, 10 months ago by [richesio](https://wordpress.org/support/users/richesio/).
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/create-a-shortcode-to-replace-classic-widget/#post-16959449)
 * Oh, there’s one more parameter that you may want to use [@richesio](https://wordpress.org/support/users/richesio/):
   _limit_. By default the shortcode will pull the top 10 posts, you may want to
   tweak that as I think it was previously showing 5 posts? For example:
 *     ```wp-block-code
       [wpp range='last24hours' limit=5 post_type='post' thumbnail_width=484 thumbnail_height=272 wpp_start='<ul class="wpp-list wpp-list-with-thumbnails">' wpp_end='</ul>']
       ```
   
 *  Thread Starter [richesio](https://wordpress.org/support/users/richesio/)
 * (@richesio)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/create-a-shortcode-to-replace-classic-widget/#post-16959456)
 * Ah perfect.
 * I checked the GitHub link and was able to pull through posts from certain categories
   too.

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

The topic ‘Create a shortcode to replace classic widget’ 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/)

 * 4 replies
 * 2 participants
 * Last reply from: [richesio](https://wordpress.org/support/users/richesio/)
 * Last activity: [2 years, 10 months ago](https://wordpress.org/support/topic/create-a-shortcode-to-replace-classic-widget/#post-16959456)
 * Status: resolved