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 (newPageHTML) {
jQuery('.blog-items').replaceWith(
jQuery(newPageHTML).find('.blog-items')
);
});
Related Posts:
- How to “Load More” posts via AJAX?
- load next and previous posts by Ajax and URL update
- How to load next and previous posts by Ajax
- Pagination Using ajax
- Hide Load more Ajax button if there is no more users to load or less than the number?
- change wordpress pagination url after doing the request
- ajax load more instead of pagination
- Adding pagination to Ajax Query
- WP admin ajax Pagination issue
- How to paginate Ajax result
- WordPress Pagination with ajax – Dots
- how to update pagination after ajax call page 2 show 0
- Access to a data from a response AJAX called in a template file php
- Using Ajax with a Class file
- Displaying PHP Errors from admin-ajax.php
- wp_set_auth_cookie() doesn’t work in Ajax call
- Stop admin-ajax?
- Is it safe to assume that a nonce may be validated more than once?
- Help making my pagination plugin better
- How to verify nonce from Bulk/Quick Edit in save_post?
- store/cache ajax sent data to avoid repeated request
- Trying to load content of a post via AJAX
- Insert Post using Ajax
- How can I automatically login using a URL?
- Run again current query via ajax but changing a var
- Problems with creating sortable sections in customizer
- Quick Edit: Selected Custom Taxonomy Not Refreshing After Save
- Ajax Request not coming back to class
- wp_verify_nonce always returns false when logged in as admin
- Ajax requests with different WordPress Address and Site Address setup
- query vars in url work but not in ajax call
- is_home doesn’t affect content
- How to declare a JS variable in an AJAX call
- is_page() conditional not working inside an AJAX function
- How to check an ajax nonce in PHP
- jQuery Ajax passing empty parameters to my function?
- admin-ajax.php slows down, but cant figure out which plugin
- Convert this relative path to absolute
- Load WP content with ajax less server demanding and faster than normal page loading?
- admin-ajax.php slow website, how to fix
- WP Admin AJAX Security – using POST to include a relative URL
- Admin-ajax.php 400 error
- ajax nonce verification failing
- admin-ajax.php ” Missing argument 2″ warning
- Update get_pages using ajax on form select change
- How to create an ajax endpoint without js?
- AJAX Load more on CPT returning random posts
- WordPress admin-ajax.php not available for subscribers/contributors
- get_queried_object_id in AJAX
- Should I check for privileges before hooking into `wp_ajax_$handle` or after?
- Making an ajax request from a different domain
- Images loading over http instead of https
- Ajax login without redirect/reload
- wp_mail 200 response but no mail sent
- Ajaxify Form That Submits To Same Page To Display Post Data [closed]
- wp_ajax_ works fine but wp_ajax_nopriv_ returns HTML and not calling function
- Why is wp_localize_script returning false?
- Change header.php after ajax call
- Retrieve JSON file from JS trough php
- WordPress – admin-ajax.php returns 502 Bad Gateway [closed]
- Using admin-ajax prevents regular php form submission
- Sql formatting for post data within function
- Get returned URL from wp_remote_post if response code is 302
- Send checkbox status with Ajax / JSON and save it
- ajax refresh to display new posts
- wp ajax execution time aborted 30 sec
- wp_ajax action is not run when ajax trigger
- Replace link with form to pass variables to javascript / ajax
- Fetch value using AJAX in WordPress
- Can I use application/json content type in WordPress
- How to pass value from ajax to php in no conflict mode?
- What is the relationship between UFW (firewall) being enabled and cron job running?
- WPBakery post content inside Bootstrap Modal
- 400 Bad request while submitting form using AJAX
- AJAX POST Value not being returned – WordPress – AutoTrader API
- Its possible to ajax update the content of the admin custom post type list
- WordPress custom ajax login not working on mobile browsers
- Failed to load resource: the server responded with a status of 404 (Not Found) admin-ajax.php
- Javascript output now showing in custom widget
- Ajax call on class returns old data
- how to enable ajax on submitting of contact form 7?
- Create a post with REST API and adding a category
- Using AJAX on Contact-form the WordPress way
- Retrieve Header Background Image with AJAX
- Error while submitting form using AJAX and php
- AJAX call in backend results in empty update_option
- Ajax Comment: Page reloads whenever the comment submission form is reloaded
- How to fetch meta_value and meta_key in matrix after ajax request by post_id
- wp_ajax_action, wp_ajax_nopriv_action not working
- get_comments() returns empty array if called through AJAX
- How to get parent comment’s id?
- Static var overwritten with WP AJAX action, works fine without AJAX
- Dynamic dependent select box getting null value
- get_template_part() does not render after the ajax request
- Add “load more” functionality to an AJAX response
- Bad Request 400… jQuery ajax post of json data to wordpress admin-ajax.php
- Why are the most recent posts not appearing in a fetch request, unless I’m logged in?
- Successful ajax call returns lots of whitespace and text of code with 0
- How to submit a button automatically after every scheduled hours?
- At what stage does wp_ajax hooks gets applied during WordPress request?