M
M
Mogambus2021-10-28 08:50:51
AJAX
Mogambus, 2021-10-28 08:50:51

Why does ajax pagination for archive page not work?

Good day.

There is a custom post - "ploshadki", its taxonomy is "ploshadka", the taxonomy has 3 terms (as categories) - "Site1", "Site2", "Site3".

There are 3 links on the page, when you click on one link, posts related to "Site1" should be displayed. When you click on the link two - posts "Platform2", etc.

How to properly set up an Ajax request so that pagination works during the output?

I did both through new WP_Query () and through query_posts (), always get links like this:
192.168.31.135/wp-admin/admin-ajax.php/page/2/?act...
Pagination correctly counts pages, but links are obtained not valid...
It should look like this:
sitename.ru/ploshadki/page/2

As far as I understand, through new WP_Query () and query_posts () - pagination on the archive page will not work as it should, and somehow it is necessary to replace the values ​​in pre_get_posts, but how can this be done dynamically using ajax?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question