the_posts_pagination() ——wordpress paging principle
I have never understood the paging principle of wordpress lists. I finally figured it out today.
The list and pagination data of wordpress are written in the global parameter: $wp_query. As long as the queried list data is put into this parameter, you can use the_posts_pagination() or get_the_posts_pagination() to display the pagination. As for the page that appears after clicking the pagination, Don't worry, wordpress has already done it.
Code:
global $wp_query;
$wp_query=new WP_Query($arg);
Then, you can use the_posts_pagination() to display pagination under this list.