Page refreshing after clicking load more button
-
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.
- The topic ‘Page refreshing after clicking load more button’ is closed to new replies.