Title: two columns content layout
Last modified: August 19, 2016

---

# two columns content layout

 *  [dunkkan](https://wordpress.org/support/users/dunkkan/)
 * (@dunkkan)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/two-columns-content-layout/)
 * Hello,
 * I’ve been searching for a method to split the post’s content automatically, in
   order to control by html the page layout, in two columns side by side i.e.
 * I’ve found a very useful [thread](http://wordpress.org/support/topic/68137?replies=9),
   and, using the first formula there provided, I’ve realized the last post’s word
   disappears, don’t know why.
 * Here I’m going to reproduce the code we can find in the topic. I quote:
 * “Add the following just after the start of The Loop in your Page template:
 *     ```
       <?php
       $numchars = strlen($post->post_content);
       $content = wordwrap($post->post_content, $numchars/2, "{{break}}");
       $content = split("{{break}}", $content);
       ?>
       ```
   
 * Then (again in your template) within each column, you want to replace the_content()
   template tag with these:
 * First column:
    `<?php echo apply_filters('the_content', $content[0]); ?>`
 * Second column:
    `<?php echo apply_filters('the_content', $content[1]); ?>` “
 * Can anybody confirm the code works well ?
    For me, as said, the last word just
   get lost. Also, I’ve had some problems with a post containing some hyperlinks,
   and which seemed to break the entire layout (once more, no idea).
 * If someone try it out, thanks for reporting any result.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [jcarpent](https://wordpress.org/support/users/jcarpent/)
 * (@jcarpent)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/two-columns-content-layout/#post-892874)
 * Dunkkan,
 *  I’m considering starting a blog and using WordPress. Your description of the
   two column functionality is exactly what I’m looking to do. Did you ever resolve
   the missing word? Once I get it going, I will try your code out and let you know
   how it worked.
 * Thanks,
    Jcarpent
 *  [mikeostrich](https://wordpress.org/support/users/mikeostrich/)
 * (@mikeostrich)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/two-columns-content-layout/#post-892875)
 * Dunkkan, thanks for the info. I’m trying to do something similar, and this code
   is moving in the right direction for what i’m trying to achieve
 * Mike
 *  [sknowlton](https://wordpress.org/support/users/sknowlton/)
 * (@sknowlton)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/two-columns-content-layout/#post-892933)
 * array/string lengths can be funny… without getting too technical, I’ll just say
   change your code to the following:
 *     ```
       <?php
       $numchars = strlen($post->post_content);
       $content = wordwrap($post->post_content, $numchars/2+2, "{{break}}");
       $content = split("{{break}}", $content);
       ?>
       ```
   
 *  [anlisa](https://wordpress.org/support/users/anlisa/)
 * (@anlisa)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/two-columns-content-layout/#post-892947)
 * Hey this is just what I was looking for.
 * I’ve been dreaming about making a horizontal theme that scrolls sideways when
   the mouse scrolls. Mootools can do this.
 * Is it possible to have an infinite number of columns, so that the post can just
   split itself into columns (that are the height of the browser) that just continue
   to the right – horizontally.
 * I know it’s a long shot, but if anyone knows that would be great.
 *  [petenawara](https://wordpress.org/support/users/petenawara/)
 * (@petenawara)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/two-columns-content-layout/#post-892949)
 * This is exactly what I was looking for as well. A HUGE help.. Could someone give
   me a rundown of how the math for the wordwrap is working? I have some images 
   in these pages that are somewhat consistently placed and therefore the first 
   column is significantly larger than the second.
 * Any help on this would be greatly appreciated.
 * Thanks,
    Pete

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘two columns content layout’ is closed to new replies.

## Tags

 * [columns](https://wordpress.org/support/topic-tag/columns/)
 * [content](https://wordpress.org/support/topic-tag/content/)
 * [split](https://wordpress.org/support/topic-tag/split/)
 * [two](https://wordpress.org/support/topic-tag/two/)

 * 5 replies
 * 6 participants
 * Last reply from: [petenawara](https://wordpress.org/support/users/petenawara/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/two-columns-content-layout/#post-892949)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
