title: Trim Related Products Title Length - Woocommerce
body: <p>I currently have an issue with trimming the length of the product title in the "Related Products" section of my single product page.</p>
  
  <p>I have set up a custom hook pointing to a custom template for this. The only problem is that it isn't trimming any of it - it is still printing the whole title.</p>
  
  <p>I have tried to use get_the_title() and it doesn't print anything to screen, so in the code below I have tried to pass the title as a string and not an array.</p>
  
  <p>What am I doing wrong?</p>
  
  <pre><code>&lt;?php $title = the_title('&lt;h3 class="product_title entry-title"&gt;', '&lt;/h3&gt;'); 
  
      $text = wp_trim_words($title, 2, '...')
  
  ?&gt;
  &lt;?php echo $text; ?&gt;
  </code></pre>
  
  <p>Thanks in advance
  Regards
  Michael</p>