title: Automatically split WordPress post content in to 3 columns?
body: <p>I'm currently using the following code from <a href="http://dancameron.org/code/splitting-content-into-two-columns-e-g-word-wrap-with-php-or-css-javascript/">this tutorial</a> to automatically split the WordPress post content in to 2 columns. However, how would I change this code to output 3 columns instead of only 2?</p>
  
  <p>functions.php code:</p>
  
  <pre><code>function content_split($text, $separator = '&lt;hr/&gt;', $start = false ) {
  
  if ( $start === false) {
  $start = strlen($text) / 2;
  }
  
  $lastSpace = false;
  $split = substr($text, 0, $start - 1);
  
  // if the text is split at a good breaking point already.
  if (in_array(substr($text, $start - 1, 1), array(' ', '.', '!', '?'))) {
  
  $split .= substr($text, $start, 1);
  // Calculate when we should start the split
  $trueStart = strlen($split);
  
  // find a good point to break the text.
  } else {
  
  $split = substr($split, 0, $start - strlen($separator));
  $lastSpace = strrpos($split, ' ');
  
  if ($lastSpace !== false) {
  $split = substr($split, 0, $lastSpace);
  }
  if (in_array(substr($split, -1, 1), array(','))) {
  $split = substr($split, 0, -1);
  }
  
  // Calculate when we should start the split
  $trueStart = strlen($split);
  }
  //now we know when to split the text
  return substr_replace($text, $separator, $trueStart, 0);
  
  }
  </code></pre>
  
  <p>index.php code:</p>
  
  <pre><code>&lt;div class="first-column my-column"&gt;
  &lt;?php $text = get_the_content(); $separator = '&lt;/div&gt;&lt;div class="second-column my-column"&gt;'; echo apply_filters('the_content', content_split($text,$separator)); ?&gt;
  &lt;/div&gt;
  </code></pre>