Last active
November 24, 2021 23:11
-
-
Save ahmadthedev/7e8dcade763549dc5174d6aeb33ed6b3 to your computer and use it in GitHub Desktop.
Post Read Time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Reading Time | |
function dv_reading_time( $post ) { | |
$mycontent = $post->post_content; | |
$word = str_word_count(strip_tags($mycontent)); | |
$m = floor($word / 200); | |
// $s = floor($word % 200 / (200 / 60)); | |
$est = $m . 'm read'; | |
return $est; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment