小编gab*_*zzi的帖子

分页链接不起作用/ page/2 - NOT FOUND - Wordpress

我需要在我的博客页面中创建一个分页器,直到这很好,但是当我点击我的分页链接时,我找不到FOUND页面,我需要知道我是否需要在面板中能够使用wordpress才能访问到?页= N.

功能:

    function get_pagination($the_query) {
    global $paged;
    $total_pages = $the_query->max_num_pages;
    $big = 999999999;

    if ($total_pages > 1) {
        ob_start();

        echo paginate_links( array(
            'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
            'format' => '/page/%#%',
            'current' => $paged,
            'total' => $total_pages,
            'prev_text' => '',
            'next_text' => ''
        ));
        return ob_get_clean();
    }
    return null;
}
Run Code Online (Sandbox Code Playgroud)

我的博客代码

$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
        // echo $paged;
        $produtos = new WP_Query(array(
            'post_type'      => 'blog', …
Run Code Online (Sandbox Code Playgroud)

php wordpress pagination http-status-code-404

4
推荐指数
3
解决办法
4万
查看次数

标签 统计

http-status-code-404 ×1

pagination ×1

php ×1

wordpress ×1