Split wordpress content into 2 or more column


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. Add the following code to your functions.php
  2.  
  3.  
  4. <?php
  5.  
  6. // original content display
  7.  
  8. // the_content('<p>Read the rest of this page »');
  9.  
  10. // split content into array
  11.  
  12. $content = split_content();
  13.  
  14. // output first content sections in column1
  15.  
  16. echo '<div id="column1">', $content[0], '</div>';
  17.  
  18. // output remaining content sections in column2
  19.  
  20. echo '<div id="column2">', implode(array_shift($content)), '</div>';
  21.  
  22. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.