Hi
We have instances where the filtered list of post content is complete, yet the load more button is still appearing. Can anyone help with the code needed to disable or hide the button when all posts are present?
Here’s an example listing page:
And the current code used for the button:
<script src="{{ get_asset_url('/Website 2020/Assets/JS/libraries/infinite-ajax-scroll.js') }}"></script>
<script>
$(document).ready(function(){
window.ias = new InfiniteAjaxScroll('.related-posts', {
item: '.listing-post',
next: '.next-posts-link',
pagination: '.blog-pagination',
trigger: {
element: function() {
let el = document.createElement('button');
el.innerText = 'Load More';
el.className = "ias-trigger";
document.querySelector('.related-posts').appendChild(el);
return el;
}
}
});
});
</script>
Thanks, Si