How to add Ajax to this Pagination i made?

To do this, you just need to make one ajax request in javascript. Here is a step-by-step solution. Add click handler in javascript When click send ajax request to pagination page Replace an element with “.blog-items” selector on current page from a new page jQuery(document.body).on(‘click’, ‘#pagination a’, function (event) { var linkElement = jQuery(event.currentTarget); jQuery.ajax(linkElement.attr(‘href’)).done(function … Read more

React to AJAX adding to the page

Found this at https://codex.wordpress.org/AJAX_in_Plugins JavaScript triggering the post-load event after content has been inserted via Ajax: jQuery( document.body ).trigger( ‘post-load’ ); JavaScript listening to the post-load event: jQuery( document.body ).on( ‘post-load’, function () { // New content has been added to the page. } ); I suppose it’s up to each plugin to trigger whichever … Read more