- This topic has 42 replies, 5 voices, and was last updated 1 year, 6 months ago by Tom.
December 3, 2020 at 8:57 am #1566088Sourabh
how to add Post Visit Counter and Mins Read time in each post ??
Regds:December 3, 2020 at 11:53 am #1566301LeoStaffCustomer Support
A plugin like this might help:
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-1060767December 4, 2020 at 12:18 am #1566839Sourabh
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 ??December 4, 2020 at 2:03 am #1566912ElvinStaffCustomer Support
The code from this one is a PHP snippet.
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.
A wise man once said:
"Have you cleared your cache?"December 4, 2020 at 2:17 am #1566923Sourabh
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 ??December 4, 2020 at 9:34 am #1567580DavidStaffCustomer Support
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.December 4, 2020 at 9:43 am #1567596Sourabh
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 –
Make me correct if i am moving wrong…December 4, 2020 at 9:46 am #1567600LeoStaffCustomer Support
It would normally be under Appearance > Theme Editor:
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.December 4, 2020 at 10:14 am #1567650Sourabh
I downloaded a plugin for that and edited function.php and pasted a code here –
But seems it’s not working, should I still missing something ??December 4, 2020 at 12:19 pm #1567792TomLead DeveloperLead DeveloperDecember 4, 2020 at 7:15 pm #1568012Sourabh
I want to add read mins time in to all posts without plug-ins..
I use given code but its not working.December 5, 2020 at 12:01 pm #1568733TomLead DeveloperLead Developer
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.December 6, 2020 at 6:18 am #1569211Sourabh
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 MinsDecember 6, 2020 at 12:21 pm #1569615TomLead DeveloperLead DeveloperDecember 10, 2020 at 2:24 am #1574041Sourabh
Sure… Refer Private Section
- You must be logged in to reply to this topic.