I use this code :
function tu_estimated_reading_time() {
$post = get_post();
$content = $post->post_content;
$wpm = 300; // How many words per minute.
$clean_content = strip_shortcodes( $content );
$clean_content = strip_tags( $clean_content );
$word_count = str_word_count( $clean_content );
$time = ceil( $word_count / $wpm );
var_dump( $time );
return $time;
}
add_filter( 'generate_post_author_output', function( $output ) {
$output .= '<div class="read-time">Reading time: ' . tu_estimated_reading_time() . '</div>';
return $output;
} );
but I want to have the same display for posts displayed on pages (home for example). I use Wp show Posts. How can I do that?