title: reading time php (little help if possible)
body: <p>I am in need of a little help, if it is easy to find what i am missing from my code.</p>
  <p>I wanted a reading time calculator by minutes.</p>
  <p>i have used the following code on my functions.php</p>
  <pre><code>function display_read_time() {
      $content = get_post_field( 'post_content', $post-&gt;ID );
      $count_words = str_word_count( strip_tags( $content ) );
      
      $read_time = '&lt;span class=&quot;rt-suffix&quot;&gt;' + ceil($count_words / 250);
      
       $suffix = ' min&lt;/span&gt;'; 
      
      $read_time_output = $read_time . $suffix;
  
      return $read_time_output;
  }
  
  add_shortcode( 'readingtime', 'read_time_sc' );
  function read_time_sc() {
      ob_start(); ?&gt;
              &lt;div class=&quot;reading-time&quot;&gt;
  &lt;?php echo display_read_time(); ?&gt;
  &lt;/div&gt;
      &lt;?php
      return ob_get_clean();
  }
  </code></pre>
  <p>I inserted the function that calculates it and i made a shortcode to use it freely on my site…</p>
  <p>I have also appended the following html on the left sidebar</p>
  <pre><code>&lt;div class=&quot;scroll-progress-wrap&quot;&gt;
      &lt;div id=&quot;circ&quot; class=&quot;p0&quot;&gt; 
          [readingtime]
      &lt;/div&gt; 
  &lt;/div&gt;
  </code></pre>
  <p>As you will see it generates a number, but it is always 1, no matter what i do…</p>
  <p>Do you have any idea anything i could try?</p>
  <p>Thank you in advance!</p>
  <p><a href="https://thefinterest.kinsta.cloud/p/uncategorized/asjalska/" rel="nofollow noreferrer">Link to test site</a></p>