• Resolved Sibbo100

    (@sibbo100)


    Hi Darren,

    I’ve used this plugin quite a few times on various sites and is definately the best one I’ve come across. I am building a site locally on my laptop hence the lack of page link and for some bizarre reason I’m getting an Internal Server Error when I get to 60 record loads and I’m not entirely sure why, is there a limit on the number of posts that can be loaded.

    Thanks
    Scott

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Hey Scott,
    There shouldn’t be a limit… It could be a php error in your repeater template.

    If you inspect the response from the ajax call, does it tel you anything?

    Thread Starter Sibbo100

    (@sibbo100)

    Hi Darren,
    So I’ve managed to narrow it down to a piece of code I am using in the repeater template, below is the snippet of the code that is causing the issue:

    
    <?php
        $date = get_field('downloads_date', $post->ID, false);
        $date = DateTime::createFromFormat('Y-m-d H:i:s', $date);
    ?>
        <p class="date">Updated on <?php echo $date->format('d F Y'); ?></p>
    

    As soon as I comment the above out the template works, basically I’m using an ACF date/time field on the site and need to be bale to remove the actual day and the time on this specific page (they need to appear on other pages), and the above is how I’ve managed to do that, but the Ajax Load More system doesn’t seem to like it after the first 60 items have loaded and I can’t see anything in the php.ini file that would cause this.

    This is the entire repeater template markup:

    
    <div class="publications-panel row">
        <div class="col-sm-12">
            <?php
            $date = get_field('downloads_date', $post->ID, false);
            $date = DateTime::createFromFormat('Y-m-d H:i:s', $date);
            ?>
    	<p class="date">Updated on <?php echo $date->format('d F Y'); ?></p>
        </div>
        <div class="col-sm-12">
    	<h3><?php the_title(); ?></h3>
        </div>
        <div class="col-sm-8">
    	<div class="copy"><p><?php the_excerpt(); ?></p><a href="<?php the_permalink(); ?>">Continue reading</a></div>
        </div>
        <div class="col-sm-4">
    	<p><?php the_tags('', ', ', ''); ?></p>
    	<ul class="topic-icons">
    	<?php
    	$field = get_field('header_icon');
    	?>
    	    <li>
    		<i title="<?php echo $field['label']; ?>" class="define <?php echo $field['value']; ?>" data-toggle="tooltip" data-animation="false"></i>
    	    </li>
    	</ul>
        </div>
    </div>
    

    A second pair of eyes and any thoughts would be greatly appreciated.

    Thanks
    Scott

    Plugin Author Darren Cooney

    (@dcooney)

    Hmm, not really sure but sounds like a fatal error somewhere.

    Maybe try defining global $post at the opening of your template.

    <div class="publications-panel row">
       <?php global $post; ?>
        <div class="col-sm-12">
            ....
       </div>
    </div>
    Thread Starter Sibbo100

    (@sibbo100)

    Hi Darren,

    Turns out it was a user error, I hadnb’t filled in the custom field date on one of the posts I was pulling through which was causing a meltdown.

    Thanks for looking into for me.
    Scott

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Ajax Load More Internal Server Error’ is closed to new replies.