When the news page is not on the main page the pagination happens normally, and can change pages to other news.
Now when it is set to the main page it is not possible to switch to page 2, for example, to see other news. In the address bar changes but the screen continues the same news from page 1.
Here is the code used:
<?php
echo paginate_links([
'prev_next' => false,
'base' => str_replace(999999999, '%#%', esc_url(get_pagenum_link(999999999))),
'format' => '?paged=%#%',
'current' => max(1, get_query_var('paged')),
'total' => $postslist->max_num_pages
]);
I discovered the following error:
In the address bar, when the news page is not the main page, it gets this way meusite/noticias/page/2/
. Then you can see the news on page 2;
Now, when the news is as homepage, it looks like this: meusite/page/2/
. And then the code does not identify the news page and does not display page 2.
Can you solve this problem?