title: Adding reading time to Wordpress
body: <p>I have a multisite on Wordpress where each site is for one country where the company has offices. All sites follow the same structure, only content changes from one to another.<br>
  The international/global website is the <strong>.com</strong> version, and the countries uses directories: <strong>.com/dk/</strong>, <strong>.com/de/</strong> and so on.</p>
  
  <p>I'm working to show before the post content, the tags and estimated reading time.</p>
  
  <p>On <code>functions.php</code> I have:</p>
  
  <pre><code>function reading_time() {
    $content = get_post_field( 'post_content', $post-&gt;ID );
    $word_count = str_word_count( strip_tags( $content ) );
    $readingtime = ceil($word_count / 200);
  
    $lang = get_country_code();
    $timer['lang'] = $lang;
  
    if (in_array($lang, array('Global', 'UK', 'US', 'ME'))) {
      $timer = " minutes";
    } elseif (in_array($lang, array('CO', 'CL', 'MX', 'GT', 'CR', 'EC'))) {
      $timer = " minutos";
    } elseif (in_array($lang, array('DE', 'CH'))) {
      $timer = " Minuten";
    } elseif (in_array($lang, array('DK' ))) {
      $timer = " minutter";
    } elseif (in_array($lang, array('BR' ))) {
      $timer = " minutos";
    }
  
    $totalreadingtime = $readingtime . $timer;
  
    return $totalreadingtime;
  }
  </code></pre>
  
  <p>And on <code>single.php</code> I added:</p>
  
  <pre><code>&lt;div class="post-new-metas"&gt;
      &lt;p class="post-tags"&gt;&lt;?php the_tags(); ?&gt;&lt;/p&gt;
      &lt;p class="post-reading-time"&gt;&lt;?php echo reading_time(); ?&gt;&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I'm having 2 troubles with it:<br>
    1. I want to add before the reading time "<strong>Estimated reading time:</strong>" that can change based on the language of the website.<br>
    2. The tags and reading time works on the international/global website. All other sites give me the message: <strong>You have a critical error on your website.</strong></p>
  
  <p>How can I change the function to allow this to work?</p>