• Resolved Nick Lewis

    (@nickylew)


    Hi

    I’m having some issues with the page refreshing when I click the load more button.
    I am using the standard button from the plugin, generated from the shortcode, with no other JS linked to it.

    This is happening on my localhost as well as on a staging server.
    I am using a custom repeater template, but there isn’t anything crazy code wise involved.

    The issue only seems to occur after I have visited the page more than once.
    So, visiting the page for the first time in a browser the load more works fine, but if I then revisit the page with a manual refresh or by clicking a different page and returning, the ajax doesn’t seem to work properly. Clicking the button makes the page refresh (and loads the new content).

    My repeater code:

    
    <?php if($alm_item == 1 || $alm_item == 7){ ?>
    	<a href="<?php the_permalink(); ?>" class="col-xs-12 col-sm-6 col-md-8 tile ajax_tile">
    		<div class="tile-image" style="background-image: url('<?php echo get_the_post_thumbnail_url($post->ID, "medium"); ?>');"></div>
    		<div class="tile-content">
    			<h4><?php echo get_the_title($post->ID); ?></h4>
    			<p class="date">Posted on: <?php echo get_the_date(); ?></p>
    			<p class="excerpt"><?php echo excerpt(20); ?></p>
    		</div>
    	</a>
    <?php } else { ?>
    	<a href="<?php the_permalink(); ?>" class="col-xs-12 col-sm-6 col-md-4 tile ajax_tile square">
        	<div class="tile-image" style="background-image: url('<?php echo get_the_post_thumbnail_url($post->ID, "thumbnail"); ?>');"></div>
    		<div class="tile-content">
    			<h4><?php echo get_the_title($post->ID); ?></h4>
    			<p class="date">Posted on: <?php echo get_the_date(); ?></p>
    			<p class="excerpt"><?php echo excerpt(20); ?></p>
    		</div>
    	</a>
    <?php } ?>
    

    I have tested in Chrome, Safari and FireFox. All up to date versions.

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

    (@dcooney)

    Hi @nickylew,
    I had a look and I’m thinking your issue is another script is hooked into an Ajax complete and causing the refresh.

    This could be another plugin or a custom script. Nothing is being dispatched in the inspector so it’s hard to track it down but i’d start by looking at your preloader script.

    Hope this helps.

    Thread Starter Nick Lewis

    (@nickylew)

    Ahah! Yes, it was to do with my loading animations.

    I’m using Pace.js to control this, and didn’t quite have the correct loading / options for this set to work nicely with Ajax.

    Thanks for the help @dcooney

    Sorry for adding the ticket everywhere!

    Plugin Author Darren Cooney

    (@dcooney)

    No problem, glad thats sorted ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Page refreshing after clicking load more button’ is closed to new replies.