Archived topic
Show Reading Time on Post Only
5 replies · Started by Danar Virdaus on January 26, 2021
Viewing posts 1–6 of 6
Hello,
I use this code to show estimated reading time:
https://generatepress.com/forums/topic/creating-an-estimated-reading-time/page/2/#post-647138
How to show estimated reading time only on single posts? With that codes, it showed on both single posts and archives.
thank you in advance :)
You could try this
add_filter( 'generate_post_date_output', function( $output ) {
if(is_single() {
$output .= '<div class="read-time">Reading time: ' . tu_estimated_reading_time() . '</div>';
}
return $output;
} );
syntax error, unexpected ';' :D
Sorry - I missed a closing bracket
add_filter( 'generate_post_date_output', function( $output ) {
if(is_single()) {
$output .= '<div class="read-time">Reading time: ' . tu_estimated_reading_time() . '</div>';
}
return $output;
} );
Ahh It Works! :)
Thank You Natalie ;)
Thanks Natalie :)
This archived topic is closed to new replies.