admin管理员组文章数量:1431918
When I click on page 2, there is a 404 page.
How could i fix it ?
This is my pagination on archive.php
<?php
global $query;
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $query->max_num_pages,
'before_page_number' => '<span class="screen-reader-text">'.$translated.' </span>'
) );
?>
When I click on page 2, there is a 404 page.
How could i fix it ?
This is my pagination on archive.php
<?php
global $query;
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $query->max_num_pages,
'before_page_number' => '<span class="screen-reader-text">'.$translated.' </span>'
) );
?>
Share
Improve this question
edited Apr 12, 2019 at 15:46
fuxia♦
107k39 gold badges255 silver badges459 bronze badges
asked Apr 12, 2019 at 14:30
WDCreativWDCreativ
32 silver badges6 bronze badges
1
|
1 Answer
Reset to default 0Your only real reason to try and use paginate_links()
seems to be your custom 'before_page_number'
argument.
Ditch your code and use the_posts_pagination();
instead, pass it only the 'before_page_number'
argument in an array.
本文标签: 404 errorPlease Help me with Archive 404 Pagination
版权声明:本文标题:404 error - Please Help me with Archive 404 Pagination 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745594469a2665390.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
query_posts
at the top of your archive template? – Tom J Nowell ♦ Commented Apr 12, 2019 at 14:51