Archived topic
view counter for posts
7 replies · Started by Nave on April 18, 2021
Hi support team
I want to add an element to the post template that will count the number of users that viewed that post/article.
So that will be a tiny icon with an "eye" symbol and then the count of views. Also I wish to start from a minimum number to start view count from there.
Is this possible?
Thanks,
Nave
Hi there,
post view count isn't something that WP does out of the box.
Simplest method is to use this plugin:
https://en-gb.wordpress.org/plugins/post-views-counter/
It provides a shortcode that can be added to your site using a hook element - if the plugins display positions are not right for you.
Thanks David, I downloaded the plugin and it works.
I want it to show inside the GP element post template I built, can I enter the shortcode inside GP element somehow using Gutenberg editor?
This is example of a post:
https://selery.co.il/tax-b/125/
I want it to be inside the post menu, right after the tag placeholder
Thanks again
Nave
Hi Nave,
I believe a hook element would be what you need:
https://docs.generatepress.com/article/hooks-element-overview/
https://docs.generatepress.com/article/hooks-visual-guide/
Let me know if this helps :)
Hi Leo
I the hook element options doesn't help because I built the post template inside GP element. ( all the post content is inside the element with dynamic options )
attached image of where I want it to be: https://prnt.sc/11qjv00
Edit the Block Element you have created. You can add a Headline Block where you want the Post Count to be displayed, and add the Shortcode inside the headline block.
Thanks!
You're welcome