• Resolved EOSlover

    (@eoslover)


    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://www.ads-software.com/plugins/ajax-load-more/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter EOSlover

    (@eoslover)

    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

    (@dcooney)

    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.