Title: Migrate widget into shortcode
Last modified: September 15, 2023

---

# Migrate widget into shortcode

 *  Resolved [beitsiach](https://wordpress.org/support/users/beitsiach/)
 * (@beitsiach)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/migrate-widget-into-shortcode/)
 * Hello Hector,
 * I have written to you a couple of days ago on your [website page](https://cabrerahector.com/wordpress/wordpress-popular-posts-6-3-new-shortcode-to-display-views-count-php-8-compatibility-improvements/)
   and asked how to translate all your instructions.
 * I had a Popular posts widget in my footer, but it no longer works. I got lost
   in the shortcodes you listed and don’t know how to make a shortcode instead of
   the widget. I would like it to show the following preference:
    1. 3 posts
    2. with tumbnails 75x75px
    3. with title
    4. with date of publish (preferrably in format DD/MM/YY)
    5. with post views
    6. sorted by most popular of all time (it can be other time period)
 * Thank you for your kind assistance.
 * Vera
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fmigrate-widget-into-shortcode%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/migrate-widget-into-shortcode/#post-17054940)
 * Hi [@beitsiach](https://wordpress.org/support/users/beitsiach/),
 * Could you please share screenshots of the settings you’re using with the widget
   so I can help you migrate it to the shortcode version?
 * Also, I tried checking your website but apparently is currently under maintenance
   or something.
 * ![](https://i0.wp.com/i.postimg.cc/8cgjbFww/eichut-net.png?ssl=1)
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/migrate-widget-into-shortcode/#post-17077083)
 * Marking as resolved due to inactivity.
 * OP if you still need assistance with this please leave a comment below.
 *  Thread Starter [beitsiach](https://wordpress.org/support/users/beitsiach/)
 * (@beitsiach)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/migrate-widget-into-shortcode/#post-17080519)
 * Hector thank you,
 * I apologize for the delay. There were, indeed, some unexplained problems on my
   site, which took time to try to solve (no use sending you anything if you cannot
   even go into the site). Somehow, it was resolved.
 * In addition, we are in the middle of the High Jewish Holidays, so really, I apologgize.
 * I don’t know how to send screenshots here, can’t see any attachment button. I
   can also give you credentials to log in, but where do I send it?
 * Thank you,
 * Vera
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/migrate-widget-into-shortcode/#post-17080550)
 * You can upload those screenshots somewhere (eg. the Media library), then paste
   the image URLs here so I can have a look.
 * Also, please refrain from offering anyone credentials on this site, that’s explicitly
   prohibited as per [WordPress Forum Guidelines](https://wordpress.org/support/guidelines/#the-bad-stuff)(
   I know you meant good but that’s frowned upon here for good reasons).
 *  Thread Starter [beitsiach](https://wordpress.org/support/users/beitsiach/)
 * (@beitsiach)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/migrate-widget-into-shortcode/#post-17084050)
 * Oh, I did not know that, beg pardon. Strange, though, as I have been asked for
   them often enough…
 * But thank you, will take care not to offer in future.
 * Here are the screenshots. The site is bilingual, but the footer has somehow lot
   its translation to English and this is in the original. (I am addressing this
   in other avenues). PErhaps I am trying to do something wrong here, bit then it
   doesn’t work at all, so…
 * Thank you,
 * Vera
 * [https://eichut.net/wp-content/uploads/2023/09/Screenshot-2023-09-27-232756.png](https://eichut.net/wp-content/uploads/2023/09/Screenshot-2023-09-27-232756.png)
 * [https://eichut.net/wp-content/uploads/2023/09/Screenshot-2023-09-27-232849.png](https://eichut.net/wp-content/uploads/2023/09/Screenshot-2023-09-27-232849.png)
 * [https://eichut.net/wp-content/uploads/2023/09/Screenshot-2023-09-27-232943.png](https://eichut.net/wp-content/uploads/2023/09/Screenshot-2023-09-27-232943.png)
 * [https://eichut.net/wp-content/uploads/2023/09/Screenshot-2023-09-27-233105.png](https://eichut.net/wp-content/uploads/2023/09/Screenshot-2023-09-27-233105.png)
 * [https://eichut.net/wp-content/uploads/2023/09/Screenshot-2023-09-27-233124.png](https://eichut.net/wp-content/uploads/2023/09/Screenshot-2023-09-27-233124.png)
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/migrate-widget-into-shortcode/#post-17084369)
 * Thanks!
 * Alright, please try following these instructions and report back your results:
 * **#1** Go to **Appearance > Widgets > [Your site’s sidebar]** and add a **Custom
   HTML** widget right below your “Popular Posts” one.
 * **#2** Set a title for your Custom HTML widget (eg. Popular Posts).
 * **#3** Insert the following shortcode into the Custom HTML widget:
 *     ```wp-block-code
       [wpp range='all' limit=3 post_type='post' cat='7,847' stats_views=1 stats_date=1 stats_date_format='d/m/Y' thumbnail_width=75 thumbnail_height=75 wpp_start='<ul class="wpp-list">']
       ```
   
 * **#4** Save changes.
 * **#5** Add this PHP code snippet to your site, either via your theme’s functions.
   php or via the [Code Snippets](https://wordpress.org/plugins/code-snippets/) 
   plugin for example:
 *     ```wp-block-code
       add_filter( 'widget_text', 'do_shortcode' );
       ```
   
 *  Thread Starter [beitsiach](https://wordpress.org/support/users/beitsiach/)
 * (@beitsiach)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/migrate-widget-into-shortcode/#post-17087951)
 * Hector,
 * I work with Elementor, as you may have seen on the pics.
 * So I put in an HTML widget and pasted your code.
 * Put the code in the file for Astra child.
 * IT appears to just sit there as code.
 * Vera
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/migrate-widget-into-shortcode/#post-17088257)
 * Ah, in that case you can use [Elementor’s Shortcode widget](https://elementor.com/help/shortcode-widget/)
   instead [@beitsiach](https://wordpress.org/support/users/beitsiach/). The shortcode
   will appear to be stuck on the loading animation while editing the page but it’ll
   work as intended on the front-end.
 *  Thread Starter [beitsiach](https://wordpress.org/support/users/beitsiach/)
 * (@beitsiach)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/migrate-widget-into-shortcode/#post-17091379)
 * Hector,
 * That works great, thank you so much.
 * Vera

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

The topic ‘Migrate widget into 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/)

## Tags

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

 * 9 replies
 * 2 participants
 * Last reply from: [beitsiach](https://wordpress.org/support/users/beitsiach/)
 * Last activity: [2 years, 8 months ago](https://wordpress.org/support/topic/migrate-widget-into-shortcode/#post-17091379)
 * Status: resolved