Thanks David.
I am assuming that the example code below has to be added to the functions.php file.
If yes, the shortcode, {{reading-time}}, in the header element doesn’t return a value but rather displays {{reading-time}} verbatim.
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 );
return $time;
}
add_shortcode('reading-time', 'tu_estimated_reading_time');