Migrate widget into shortcode
-
Hello Hector,
I have written to you a couple of days ago on your website page 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:
- 3 posts
- with tumbnails 75x75px
- with title
- with date of publish (preferrably in format DD/MM/YY)
- with post views
- 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 to see the link]
-
Hi @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.

Marking as resolved due to inactivity.
OP if you still need assistance with this please leave a comment below.
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
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 (I know you meant good but that’s frowned upon here for good reasons).
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-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-233105.png
https://eichut.net/wp-content/uploads/2023/09/Screenshot-2023-09-27-233124.png
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:
[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 plugin for example:
add_filter( 'widget_text', 'do_shortcode' );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
Ah, in that case you can use Elementor’s Shortcode widget instead @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.
Hector,
That works great, thank you so much.
Vera
The topic ‘Migrate widget into shortcode’ is closed to new replies.