Archived topic
Post Visit Counter and Mins Read time
42 replies · Started by Sourabh on December 3, 2020
HI,
how to add Post Visit Counter and Mins Read time in each post ??
Regds:
Hi there,
A plugin like this might help:
https://wordpress.org/plugins/post-views-counter/
And you can try something like this for the read time:
https://generatepress.com/forums/topic/see-the-reading-time-in-a-post-page-home/#post-1060767
No, I don't want to add a plugin for the post-visit counter hence requested code, I am already aware that I can do with plugins but they create a problem later, so please provide if I can do via code, etc
And for reading time actually, I could not understand which types of codes these are, it's not looking like CSS, if this is PHP, so how to use it ??
Hi,
The code from this one is a PHP snippet.
https://generatepress.com/forums/topic/see-the-reading-time-in-a-post-page-home/#post-1060767
Here's how to add PHP - https://docs.generatepress.com/article/adding-php/
As for post visit counters, you can try looking for articles like this but we really can't guarantee if it'll work.
https://www.themexpert.com/blog/track-display-post-views-in-wordpress
Hi, I don't want to load my website with plugins so won't prefer adding PHP using plugins however I use a child theme for generate press so guide me on how to do that ??
where should I find function.php in the child theme??
should I paste codes at the bottom directly and save or is there any specific place ??
PHP Snippets can be added to Child Theme functions.php - you can add them after any other functions you have already in there.
In regards to using plugins - Code is Code, so a well coded plugin will be as performant as any custom code you add. The advantage of using a plugin it comes with Developer support. If you're not a developer yourself then it is far better to use a plugin.
Okay but your answer is half David, I asked where should I find function.php in a child theme, as I tried all in these options but didn't find one -
https://www.dropbox.com/s/hz21unh5i5x8cnv/function.php.png?dl=0
Make me correct if i am moving wrong...
It would normally be under Appearance > Theme Editor:
https://www.screencast.com/t/0IF0o9na
Looks like you don't have that option though and I'd assume it's a permission issue which the theme itself doesn't control.
Try googling "theme editor missing wordpress" to see some debugging tips.
I downloaded a plugin for that and edited function.php and pasted a code here -
https://www.dropbox.com/s/626vyjsuc93p8gd/read%20mins.png?dl=0
But seems it's not working, should I still missing something ??
That code adds it to WP Show Posts - is that what you're wanting?
I want to add read mins time in to all posts without plug-ins..
I use given code but its not working.
This code you linked to: https://www.dropbox.com/s/626vyjsuc93p8gd/read%20mins.png?dl=0
Does not match the code provided here: https://generatepress.com/forums/topic/see-the-reading-time-in-a-post-page-home/#post-1060767
The code you're using is for WP Show Posts (not GeneratePress).
The code in that GP post is for GeneratePress.
I was confused after your comments for CSS hence I only replaced "generate_post_author_output" however I have corrected that now, and it's looking like below -
Reading time: 4
Reading time: 2
Reading time: 1
how to make this format correct like below and set it with meta of each post by default-
Format - Reading Time - 5 Mins
Can you link us to the page so we can take a look?
Sure... Refer Private Section