Title: Two posts per repeat
Last modified: August 30, 2016

---

# Two posts per repeat

 *  Resolved [EOSlover](https://wordpress.org/support/users/eoslover/)
 * (@eoslover)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/two-posts-per-repeat/)
 * Hi there!
 * I have to say that your plugin is pretty great. I’ve just installed it and it
   works like a charm. I have one issue/dilemma with it.
 * I’m trying to output two posts per div, while there is posts. So if I want to
   repeat 5 posts they would be outputted:
 *     ```
       1 2
       3 4
       5
       ```
   
 * I tried using IF in the repeater template, but all I managed to do is to nest
   the posts one insde the other.
 *     ```
       <?php
       	$ajaxcounter = 0;
   
       	if ( $ajaxcounter == 0 ) {
       		?><div class="home_doublehold"><?php
       	}
       	?><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="home_doublehold_block">
       		<h2><?php the_title(); ?></h2>
       		<p><?php the_excerpt(); ?></p>
       		<p class="home_doublehold_more">Read entire article</p>
       	</a><?php
       	$ajaxcounter++;
   
       	if ( $ajaxcounter == 0 || $ajaxcounter == 2 )	{
       		?></div><?php
       	}
   
       	if ( $ajaxcounter == 2 ) {
       		$ajaxcounter = 0;
       	}
       ?>
       ```
   
 * [https://wordpress.org/plugins/ajax-load-more/](https://wordpress.org/plugins/ajax-load-more/)

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

 *  Thread Starter [EOSlover](https://wordpress.org/support/users/eoslover/)
 * (@eoslover)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/two-posts-per-repeat/#post-6727753)
 * I would like to state that I’ve found a solution using **$alm_loop_count** that
   is not actually listed in the official documentation (even though the author 
   said it was).
 * Please note that the **$alm_loop_count starts with 1**, not 0.
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/two-posts-per-repeat/#post-6727895)
 * Nice work.
 * > I would like to state that I’ve found a solution using $alm_loop_count that
   > is not actually listed in the official documentation (even though the author
   > said it was).
 * What do you mean?

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

The topic ‘Two posts per repeat’ 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/)

 * 2 replies
 * 2 participants
 * Last reply from: [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/two-posts-per-repeat/#post-6727895)
 * Status: resolved