WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to place two columns side by side like a newspaper does and display one post's content within both.

multy column newspaper article

I've been trying to explode the content at my h4/90 words and echo the rest of the content along with its own markup but it won't display. At this point I'm questioning even my method. Any advice would be appreciated.

if (have_posts()) : while (have_posts()) : the_post(); 

$content = get_the_content();

add_filter('the_content', 'multi_content');
 function multi_content($content){
 $columns = explode('<h4>', $content);
 $i = 0;
 foreach ($columns as $column){
 $return .= "<div class=\"column\" id=\"content-$i\">" . "\n";
 if ($i > 1) $return .= "<h4>";
 $return .= $column;
 $return .= '</div>';
    echo $return;
 // $content = wpautop($return);
 // else
 // $content = wpautop($content);
 // return $content;
share|improve this question

Turns out there are specific CSS properties for columns:

Here's what worked for my case:

.featured {
       -moz-column-count: 3;
       -moz-column-gap: 40px;
       -webkit-column-count: 3;
       -webkit-column-gap : 40px;
       -moz-column-rule-color:  #ccc;
       -moz-column-rule-style:  solid;
       -moz-column-rule-width:  1px;
       -webkit-column-rule-color:  #ccc;
       -webkit-column-rule-style: solid ;
       -webkit-column-rule-width:  1px;

And two refs for several other ways to go about it.

ADVANCED 2 column looping

SIX WAYS to use multiple columns

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.