• Hi, support!

    I’ve a problem in only category page on my website.

    If I open console dev, I find this error:

    Error:  TypeError: Cannot read property 'postcount' of undefined
        at Object.n.AjaxLoadMore.success (ajax-load-more.min.js?ver=5.4.3:6)
        at ajax-load-more.min.js?ver=5.4.3:6
    ajax-load-more.min.js?ver=5.4.3:6 Error Msg:  Cannot read property 'postcount' of undefined
    ajax-load-more.min.js?ver=5.4.3:6 ALM Error started in adminajax
    

    the strange thing is that if I click on the button 3 times then the posts are loaded. The problem is only in one category and 6 articles are not loaded. Can you help me? Thank you

    The page I need help with: [log in to see the link]

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

    (@dcooney)

    @leonidesign I’ve had a few of these reports lately.
    Can you please share your repeater template?

    Thread Starter Pietro

    (@leonidesign)

    Sure @dcooney thanks.

    
    <li class="listing-item-grid-1" <?php if (!has_post_thumbnail()) { ?> class="no-img"<?php } ?>>
       <?php if ( has_post_thumbnail() ) { the_post_thumbnail('alm-thumbnail'); }?>
       <h2 class="title"><a>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
       <!--<p class="entry-meta"><?php the_time("F d, Y"); ?></p>-->
    <?php
    $excerpt = get_the_excerpt(); 
    $excerpt = substr( $excerpt, 0, 105 ); // Only display first 260 characters of excerpt
    $result = substr( $excerpt, 0, strrpos( $excerpt, ' ' ) );
    echo '<p class="post-summary">'.$result.'</p>';
    ?>
       <?php //the_excerpt(); ?>
    </li>
    
    • This reply was modified 3 years, 11 months ago by Pietro.
    Plugin Author Darren Cooney

    (@dcooney)

    It may not be related to the issue you are facing, but you have an error in the <h2/> element.

    Try this and please clear your site cache.

    <li class="listing-item-grid-1" <?php if (!has_post_thumbnail()) { ?> class="no-img"<?php } ?>>
    	<?php if ( has_post_thumbnail() ) { 
    		the_post_thumbnail('alm-thumbnail'); }
    	?>
    	<h2 class="title">
    		<a href="<?php the_permalink();?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
    	</h2>
    	<!--<p class="entry-meta"><?php the_time("F d, Y"); ?></p>-->
    	<?php
    		$excerpt = get_the_excerpt(); 
    		$excerpt = substr( $excerpt, 0, 105 ); // Only display first 260 characters of excerpt
    		$result = substr( $excerpt, 0, strrpos( $excerpt, ' ' ) );
    		echo '<p class="post-summary">'.$result.'</p>';
    	?>
    	<?php //the_excerpt(); ?>
    </li>
    Thread Starter Pietro

    (@leonidesign)

    I’ve corrected the code, but unfortunately the problem did not go away. Do you have any other ideas?

    Thanks

    Plugin Author Darren Cooney

    (@dcooney)

    Damn, I’m not sure.
    Did you want to open a support ticket so I can have a look at the backend? I’d love to try and solve this for you and others.
    https://connekthq.com/support/?product=Ajax%20Load%20More

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Error Msg: Cannot read property ‘postcount’ of undefined’ is closed to new replies.