diff --git a/components/article.php b/components/article.php index f034e8f..4aef40a 100644 --- a/components/article.php +++ b/components/article.php @@ -6,6 +6,7 @@

+

diff --git a/functions.php b/functions.php index e5c37fc..a8a4a92 100644 --- a/functions.php +++ b/functions.php @@ -322,3 +322,19 @@ register_taxonomy('roman', 'post', ); } add_action( 'init', 'wpb_custom_new_menu' ); + +//estimated reading time +function reading_time() { + $content = get_post_field( 'post_content', $post->ID ); + $word_count = str_word_count( strip_tags( $content ) ); + $readingtime = ceil($word_count / 200); + + if ($readingtime == 1) { + $timer = " minute"; + } else { + $timer = " minutes"; + } + $totalreadingtime = $readingtime . $timer; + + return $totalreadingtime; +} \ No newline at end of file