# IMPLEMENTED: The new Reading Time module doesn't work in query loops?

**URL:** <https://forum.bricksbuilder.io/t/implemented-the-new-reading-time-module-doesnt-work-in-query-loops/14945>\
**Category:** Feature Requests / Improvements\
**Created:** [August 30, 2023, 1:09am UTC](https://forum.bricksbuilder.io/t/implemented-the-new-reading-time-module-doesnt-work-in-query-loops/14945 "2023-08-30T01:09:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![vigilante](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/vigilante/32/3421_2.png) [@vigilante](https://forum.bricksbuilder.io/u/vigilante)\
**Post date:** [August 30, 2023, 1:09am UTC](https://forum.bricksbuilder.io/t/implemented-the-new-reading-time-module-doesnt-work-in-query-loops/14945/1 "2023-08-30T01:09:09Z")

</div>

Does the Reading Time module work when used in a posts query loop? I added it, and it just shows the same reading time on all posts, which doesn’t match the reading time when it’s placed on the post single template itself.

I assume the module just doesn’t work in loops, but it would be very handy if it did since the reading time could then be in the meta of the listing archive page.

---

<div class="post-metadata">

**Author:** ![charaf](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/charaf/32/34412_2.png) [@charaf](https://forum.bricksbuilder.io/u/charaf)\
**Post date:** [August 30, 2023, 7:05am UTC](https://forum.bricksbuilder.io/t/implemented-the-new-reading-time-module-doesnt-work-in-query-loops/14945/2 "2023-08-30T07:05:08Z")

</div>

Hi @vigilante,

The reading time element calculates the reading time from the content on the page. So when using a query loop the element doesn’t have access to the post’s content. I think this is more of a feature request than a bug though.

---

<div class="post-metadata">

**Author:** ![vigilante](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/vigilante/32/3421_2.png) [@vigilante](https://forum.bricksbuilder.io/u/vigilante)\
**Post date:** [August 31, 2023, 3:40am UTC](https://forum.bricksbuilder.io/t/implemented-the-new-reading-time-module-doesnt-work-in-query-loops/14945/3 "2023-08-31T03:40:22Z")

</div>

I don’t know if it was meant to work on loops or not, if so, then it’s a bug.  
The code can certainly access the main content and count it, that’s not impossible or anything although it could be a performance drag if the count is not cached with posts or something.

In any case, I was hoping to not have to use a separate plugin for this and got excited only to see it doesn’t work in a loop so now I’m still stuck using a counting plugin anyway.

---

<div class="post-metadata">

**Author:** ![charaf](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/charaf/32/34412_2.png) [@charaf](https://forum.bricksbuilder.io/u/charaf)\
**Post date:** [August 31, 2023, 12:41pm UTC](https://forum.bricksbuilder.io/t/implemented-the-new-reading-time-module-doesnt-work-in-query-loops/14945/4 "2023-08-31T12:41:11Z")

</div>

Hi @vigilante, you’re right it makes sense for the element to be used in that context. I’ve added this to our to-do list as an improvement 🙂

---

<div class="post-metadata">

**Author:** ![Binu](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/binu/32/26034_2.png) [@Binu](https://forum.bricksbuilder.io/u/Binu)\
**Post date:** [February 13, 2024, 10:46am UTC](https://forum.bricksbuilder.io/t/implemented-the-new-reading-time-module-doesnt-work-in-query-loops/14945/5 "2024-02-13T10:46:24Z")

</div>

I’m not sure if this is good or bad; I’m not very familiar with PHP.  
but this code works for me. Put this inside the code block.

\<?php // Function to calculate reading time if (!function\_exists('calculate\_reading\_time\_wp')) { // Function to calculate reading time function calculate\_reading\_time\_wp($post\_id) { // Get post content by post ID $post\_content = get\_post\_field('post\_content', $post\_id); // Calculate number of words $word\_count = str\_word\_count(strip\_tags($post\_content)); // Average reading speed (words per minute) $average\_reading\_speed = 200; // Calculate reading time (in minutes) $reading\_time = ceil($word\_count / $average\_reading\_speed); return $reading\_time; } } // Example usage: // Get the ID of the current post $post\_id = get\_the\_ID(); // Calculate reading time for the current post $reading\_time = calculate\_reading\_time\_wp($post\_id); // Output reading time echo 'Lecture ' . $reading\_time . ' minutes'; ?\>

---

<div class="post-metadata">

**Author:** ![Matej](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/matej/32/20184_2.png) [@Matej](https://forum.bricksbuilder.io/u/Matej)\
**Post date:** [July 16, 2024, 7:30pm UTC](https://forum.bricksbuilder.io/t/implemented-the-new-reading-time-module-doesnt-work-in-query-loops/14945/6 "2024-07-16T19:30:04Z")

</div>

Hi guys,

We’ve added this feature in Bricks 1.10 beta, now available as a manual [download](https://my.bricksbuilder.io/?beta=1.10) in your account (see [changelog](https://bricksbuilder.io/release/bricks-1-10/)).

Please let us know if you are still experiencing issues.

**As with any beta release, please do not use it on a production/live website. It is only meant for testing in a local or staging environment.**

Best regards,  
M

---

<div class="post-metadata">

**Author:** ![HOSEIN](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/hosein/32/25907_2.png) [@HOSEIN](https://forum.bricksbuilder.io/u/HOSEIN)\
**Post date:** [August 26, 2024, 11:24am UTC](https://forum.bricksbuilder.io/t/implemented-the-new-reading-time-module-doesnt-work-in-query-loops/14945/7 "2024-08-26T11:24:01Z")

</div>

Hi everyone,

I still have this problem on 1.10.1 and the reading time in the query loop still shows 1 minute. Do you approve of this?

---

<div class="post-metadata">

**Author:** ![Matej](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/matej/32/20184_2.png) [@Matej](https://forum.bricksbuilder.io/u/Matej)\
**Post date:** [September 3, 2024, 12:27pm UTC](https://forum.bricksbuilder.io/t/implemented-the-new-reading-time-module-doesnt-work-in-query-loops/14945/8 "2024-09-03T12:27:24Z")

</div>

Hey.

Sorry for the late reply. I’ve tested this now and it seems that it works, as I get different reading time on every post.

 ![image](https://forum.bricksbuilder.io/uploads/default/original/3X/0/6/063f338711c5f1b773fc819f626b06a6cfb7ea95.png)

Maybe you can try with the last Bricks also. And if you set this reading time inside of a single post template, does it work?

Best regards,  
M

---

<div class="post-metadata">

**Author:** ![HOSEIN](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/hosein/32/25907_2.png) [@HOSEIN](https://forum.bricksbuilder.io/u/HOSEIN)\
**Post date:** [September 3, 2024, 12:43pm UTC](https://forum.bricksbuilder.io/t/implemented-the-new-reading-time-module-doesnt-work-in-query-loops/14945/9 "2024-09-03T12:43:12Z")

</div>

Hi @Matej,

It seems that there is a problem in the Persian language that has been confirmed [Here](https://forum.bricksbuilder.io/t/wip-reading-time-wrong-calculation-with-persian/25653/3).

---

<div class="post-metadata">

**Author:** ![Matej](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/matej/32/20184_2.png) [@Matej](https://forum.bricksbuilder.io/u/Matej)\
**Post date:** [September 3, 2024, 12:47pm UTC](https://forum.bricksbuilder.io/t/implemented-the-new-reading-time-module-doesnt-work-in-query-loops/14945/10 "2024-09-03T12:47:50Z")

</div>

Ah yeah, missed that thread. 🙂
