How to display views with a shortcode
The Post Views Counter plugin allows users to automatically display the counter on pages and/or posts. However, if they’d like to add the counter to only a few selected pages/posts or on different areas of the page/post then they can do so manually.
The Post Views Counter plugin allows you to automatically display the counter on pages and/or posts. However, if you’d like to add the counter to only a few selected pages/posts or on different areas of the page/post then they can do so manually using the [post-views] shortcode.
To use this shortcode, head over to the page or post you wish to embed the post views counter on. In its text editor, enter the [post-views] shortcode where you want the counter to be displayed.
Click the Save Draft button to continue. When you preview the post or page, it should look something like the image above.
The shortcode also provides an optional id parameter which may be used to show post views for any specified post anywhere on the page. For example [post-views id="42"] would display post views for the post of id equal to 42.
To use this, find the id of the post you wish to embed the count of. Head over to the page or post where you want to embed this post’s counter. In its text editor, enter the [post-views id="42"] shortcode where you want the counter to be displayed.
Click the Save Draft button to continue. It should look something like this: