Title: Two columns post without hacking into the plugin
Last modified: August 21, 2016

---

# Two columns post without hacking into the plugin

 *  Resolved [Justacheesyname](https://wordpress.org/support/users/justacheesyname/)
 * (@justacheesyname)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/two-columns-post-without-hacking-into-the-plugin/)
 * I have created a child theme for a template in which the posts show into two 
   columns. It was already kind of tricky to get this (if asked I’ll post the code)
   but my question is, is there any “easy” way to show posts in more than one column?
   Since the wp-loop reads post by post in the plugin, and don’t want to lose the
   changes each time you update the plugin.
 * Thanks for your time!
 * [https://wordpress.org/plugins/ajax-load-more/](https://wordpress.org/plugins/ajax-load-more/)

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

 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/two-columns-post-without-hacking-into-the-plugin/#post-5140507)
 * Hi Justacheesyname,
    Do you mean like this example? [http://connekthq.com/plugins/ajax-load-more/examples/fade-transition/](http://connekthq.com/plugins/ajax-load-more/examples/fade-transition/)
 * Are you creating custom css and adding it to your style.css?
 *  Thread Starter [Justacheesyname](https://wordpress.org/support/users/justacheesyname/)
 * (@justacheesyname)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/two-columns-post-without-hacking-into-the-plugin/#post-5140524)
 * Yes, I have a custom CSS and a custom child theme from the Neodym Theme, in which
   I had to modify the blog-template too so I could show more than one post in a
   row (i.e. 2 columns).
    So inside the main `foreach` I use $i to see if it’s pair,
   if it’s pair I close the needed `</div ... >` to jump to the next row [the theme
   uses bootstrap]. May I should do this in my style.css instead of changing the
   layouts in the templates?
 * The example is pretty much it, but I’m still looking into the plugin and the 
   code to really understand how to generate a template like that since getting 
   2 posts at once doesn’t seem to be a clean option inside the plugin loop.
 * PS: The example’s code is
    `<?php echo do_shortcode(<strong>[</strong>'[ajax_load_more
   post_type="ajax_more" posts_per_page="2" transition="fade" button_label="Load
   More Posts"]'<strong>]</strong>) ?>`
 * and should be without the brackets
    `<?php echo do_shortcode('[ajax_load_more
   post_type="ajax_more" posts_per_page="2" transition="fade" button_label="Load
   More Posts"]') ?>`
 * Thanks for the quick reply! 🙂
 *  Thread Starter [Justacheesyname](https://wordpress.org/support/users/justacheesyname/)
 * (@justacheesyname)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/two-columns-post-without-hacking-into-the-plugin/#post-5140533)
 * I can’t work with things like `width: 50%` as in the example.
    Just to show a
   bit of code from the blog-template.php and where my problem resides.
 * At the beginning of the foreach:
 *     ```
       <?php if($i % 2 == 0): ?>
         <div class="row">
       <? endif ?>
       ```
   
 * ***
 * At the end:
 *     ```
       <?php if($i % 2 != 0): ?></div><!--xx End of content row --> <? endif ?>
       <?php endforeach; ?>
       <?php if($i % 2 == 0): ?></div><!--xz Same End of content row --> <? endif ?>
       ```
   
 * Those last 2 `</div>` are in fact the same, it’s only needed if the number of
   posts is odd when the `foreach` has been finished.
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/two-columns-post-without-hacking-into-the-plugin/#post-5140538)
 * I’m a bit unclear still… sorry!
 * If you are using bootstrap, and you want 2 columns your repeater template could
   look like this:
    `<div class="col-md-6">Content Here</div>`
 * This would place each post inside a column 6 and they would align side by side
   and then repeat down the page.
 * Is that what you mean?
 *  Thread Starter [Justacheesyname](https://wordpress.org/support/users/justacheesyname/)
 * (@justacheesyname)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/two-columns-post-without-hacking-into-the-plugin/#post-5140657)
 * Exactly.
    Pretty much a noob question on my side… Didn’t realise that if overflowing
   the grid inside a row would make it jump the line down.
 * Thanks a lot for your time.
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/two-columns-post-without-hacking-into-the-plugin/#post-5140667)
 * No worries, happy to hear its working for you.

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

The topic ‘Two columns post without hacking into the plugin’ is closed to new replies.

 * ![](https://ps.w.org/ajax-load-more/assets/icon-256x256.png?rev=2944639)
 * [Ajax Load More – Infinite Scroll, Load More, & Lazy Load](https://wordpress.org/plugins/ajax-load-more/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajax-load-more/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajax-load-more/)
 * [Active Topics](https://wordpress.org/support/plugin/ajax-load-more/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajax-load-more/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajax-load-more/reviews/)

## Tags

 * [ajax](https://wordpress.org/support/topic-tag/ajax/)
 * [child theme](https://wordpress.org/support/topic-tag/child-theme/)
 * [columns](https://wordpress.org/support/topic-tag/columns/)
 * [multicolumn](https://wordpress.org/support/topic-tag/multicolumn/)
 * [rows](https://wordpress.org/support/topic-tag/rows/)
 * [scroll](https://wordpress.org/support/topic-tag/scroll/)

 * 6 replies
 * 2 participants
 * Last reply from: [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/two-columns-post-without-hacking-into-the-plugin/#post-5140667)
 * Status: resolved