-
Notifications
You must be signed in to change notification settings - Fork 81
1. Using WPP on posts & pages
Shortcodes are macro codes that allow users (that's you!) to insert bits of predefined functionalities into post/page content.
WordPress Popular Posts takes advantage of this feature so you can insert a list of popular posts on, for example, a Hall-of-Fame page or in the middle of a blog post so your readers can see what's popular / trending on your website.
The [wpp] shortcode, without passing any parameters to it, will list the most viewed posts (up to 10) within the last 24 hours. If you want to customize your popular posts list (eg. change the number of posts shown, hide/show views count, etc.) there are many parameters available that you can use to do so. For a complete list please go to WP Dashboard > Settings > WordPress Popular Posts > Parameters.
For example, this would display the top 5 viewed posts from the last 7 days:
[wpp range="last7days" limit=5 stats_views=1 order_by="views"]
And this one would output the 10 most commented posts from the last 30 days:
[wpp range="last30days" stats_comments=1 order_by="comments"]
If you're using the Block Editor on our website please make sure to use the Shortcode Block when inserting the [wpp] shortcode on your posts & pages, especially if you're using HTML-related parameters with it (like post_html). Otherwise your popular posts list may not display as expected (or at all) on your post / page.