title: Switching php character limit for responsive media queries
body: <p>I have a responsive site that has php character limits on certain blocks of text. The limit varies depending whether it's desktop, tablet or mobile but I'm struggling to switch this limit depending on the device/size.</p>
  
  <p>This is the php code I'm using to limit the text:</p>
  
  <pre><code>&lt;?php 
  ob_start();
  the_content();
  $old_content = ob_get_clean();
  $new_content = strip_tags($old_content);            
  
  if(strlen($new_content) &gt; 400) {     
      echo substr($new_content,0,400) . "..."; 
  } else {
      echo substr($new_content,0,400); 
  } ?&gt;
  </code></pre>
  
  <p>How can I switch this limit in relation to the media queries that make the site responsive? As far as I know it can't be done with css can it?</p>
  
  <hr>
  
  <p>CSS attempt:</p>
  
  <pre><code>p.tester {
      white-space: nowrap;
      width: 300px;
      overflow: hidden;
      text-overflow: ellipsis;
      min-height:300px;
  }
  </code></pre>
  
  <p>At the moment, that limits it to one line, is it possible to show 5 lines?</p>