Those of you wanting to fix the issue of this plugin stating “0 minutes and less than a minute…”, the solution is incredibly easy, thanks to lovely-written code. ??
Simply find this code:
if($time == "1") {
if($seconds >= 30) {
$minutes = $minutes + 1;
}
$estimated_time = $estimated_time.' '.$minutes . ' minute'. ($minutes == 1 ? '' : 's');
}
else {
$estimated_time = $estimated_time.' '.$minutes . ' minute'. ($minutes == 1 ? '' : 's') . ', ' . $seconds . ' second' . ($seconds == 1 ? '' : 's');
}
if($minutes < 1) {
$estimated_time = "Less than a minute";
}
$estimated_time = $estimated_time.$suffix;
echo $estimated_time;
then simply change this part from:
if($minutes < 1) {
$estimated_time = $estimated_time " Less than a minute";
to
if($minutes < 1) {
$estimated_time = "Less than a minute ";
?? Enjoy the day!!
]]>If you have a git repo, let me know and I will submit a pull request, but in the meantime:
Bad:
function post_readtime_widget() {
parent::WP_Widget(false, $name="Post reading time");
}
Good:
function __construct() {
$widget_ops = array(
'classname' => 'post_readtime_widget',
'description' => 'Post reading time'
);
parent::__construct( 'post_readtime_widget', 'Post reading time', $widget_ops );
}
]]>
hey,
great plugin. I would like to show the reading time in a post list. is there also a post_read_time() function, where I can put in a post ID to get its reading time? and also a function without an directly “echo” ?
Thank you.
]]>I have WP 3.8.4 and want to upload to 3.9.2.
In the description of the plugin says “Compatible up to: 3.4.2”
Someone using this plugin have problems uploading to 3.9.2?
Thanks.
]]>I’ve got a feature request. When I add a blogpost with a youtube video, I would like to manually change the reading time to the length of the video. Can you make this possible? Or do you have a better solution to make this work.
Jonathan
]]>How could I hide the “0 minutes” indication if the reading time is less than a minute?
This is probably the code I should modify?
if($time == "1") {
if($seconds >= 30) {
$minutes = $minutes + 1;
}
$estimated_time = $estimated_time.' '.$minutes . ' minute'. ($minutes == 1 ? '' : 's');
}
else {
$estimated_time = $estimated_time.' '.$minutes . ' minute'. ($minutes == 1 ? '' : 's') . ', ' . $seconds . ' seconde' . ($seconds == 1 ? '' : 's');
}
]]>
Would you mind adding a shortcode version in addition to the widget version?
You could probably get it setup pretty quickly at https://generatewp.com/shortcodes/
For now, this one has a shortcode: https://www.ads-software.com/plugins/estimated-post-reading-time/faq/
tyvm
]]>I added Post Reading Time to my website, but it’s only showing when I’m logged in. Any ideas?
]]>Hi There,
I’m running into a bit of trouble with plugin on my worpdress site (david.achkar.com). I started using <!–more–> to occasionally display only excerpts on the homepage. The “post reading time” is therefore confusing the time to read the excerpt (~1min) with the time to read the whole post (e.g., 7min).
Is there a way to have the plugin always display the time to read the whole post and not just the excerpt?
Thank you!
David
https://www.ads-software.com/extend/plugins/post-reading-time/
]]>Is there any way to change the text colour?
Awesome plugin, did a review on it.
https://www.ads-software.com/extend/plugins/post-reading-time/
]]>