Home › Forums › Gillion Theme › Reading time
Home › Forums › Gillion Theme › Reading time
Ah hi guys,
I have searched and searched, but i can’t seem to find where to get reading time for a blogpost. I’m sorry to bother you with this stupid question, but i’ve searched for a long time now..
Hope you can help!
Hi @nicolaivarney,
I hope you are well today and thank you for your question.
The theme automatically calculates post reading time using below code based on the number of words contained in the post.
function gillion_read_time( $string ) {
$string = strip_tags($string);
$string = preg_replace('/\s+/', ' ', trim($string));
$words = explode(" ", $string);
$words = count($words);
$min = floor($words / 200);
$sec = floor($words % 200 / (200 / 60));
if( $min < 1 ) {
return '1 min <span>'.esc_html__( 'read', 'gillion' ).'</span>';
}
if( $sec >= 20 ) {
$min++;
}
return $min . ' min <span>'.esc_html__( 'read', 'gillion' ).'</span>';
}
Best regards,
Shufflehound team
I’m very well!
I forgot to praise your beautiful site, thanks for the purchase – i’m gonna love it.
Ah. Is it possible to change this? My site is a food-blog, and I would like to change the reading time to be “preparation time” instead.. 🙂
Thanks – Ill try for a bit. Thanks for reply
Have a nice day!
You are most welcome here 🙂
If you need services beyond standard support, we've got your back!
If you'd prefer not to handle the installation yourself or need help getting started, we'll set everything up for you.
We'll help you rearrange sections, adjust spacing, and modify the page structure to fit your needs.
More complex styling changes, theme option modifications, and third-party integrations.
If you need something that's not included in the theme, we can code it for you.
Web design services to create custom sections, pages, and blocks for your theme, plus graphics and visualizations.
Full website builds, custom theme development, or plugin creation from scratch.
We'll provide a clear quote based on what you need. No hidden fees.