Php Wordpress分页链接重新加载页面

Php Wordpress分页链接重新加载页面,php,pagination,wordpress,Php,Pagination,Wordpress,我正在尝试使用WP\u Query构建一个分页的归档边栏。由于在single.php和news.php上使用相同的侧栏,因此用于WP_查询的参数不同 在news.php上,分页工作正常,但在single.php上,分页链接存在,并且具有正确的href值,但只需在单击时重新加载页面,即第1页以外的任何内容都不可访问 更新:如果这是相关的,single.php使用AddToAny的共享按钮和社交(MailChimp)插件。我已经停用了这两个功能,但这并没有解决分页的问题 有人能帮我解释一下吗?代码如

我正在尝试使用
WP\u Query
构建一个分页的归档边栏。由于在single.phpnews.php上使用相同的侧栏,因此用于
WP_查询的参数不同

news.php上,分页工作正常,但在single.php上,分页链接存在,并且具有正确的
href
值,但只需在单击时重新加载页面,即第1页以外的任何内容都不可访问

更新:如果这是相关的,single.php使用AddToAny的共享按钮和社交(MailChimp)插件。我已经停用了这两个功能,但这并没有解决分页的问题

有人能帮我解释一下吗?代码如下:

    <aside>
<header>
    <h1 class="column-title">Archive</h1>
    <hr>
</header>
<div>
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
// remove first four posts if this is the news main page 
if ( ! is_single() ) {
    // Save first four posts
    $first_four = new WP_Query ('post_type=post&orderby=date&order=desc&posts_per_page=4');
    if ( $first_four->have_posts() ) : while ( $first_four->have_posts() ) : $first_four->the_post();
        $skipIDs[] = $post->ID;
    endwhile; endif;
    wp_reset_postdata();
    // Save all posts
    $args = array(
            'post_type' => 'post',
            'orderby' => 'date',
            'order' => 'DESC',
            'posts_per_page' => -1
    );
    $all_posts = new WP_Query($args);
    while ( $all_posts->have_posts() ) : $all_posts->the_post();
        // Skip first four posts and save rest
        if ( in_array($post->ID,$skipIDs) ) { continue; };
        $offset_array[] = $post->ID;
    endwhile;
    wp_reset_postdata();
    // Final arguments for WP_Query
    $args = array(
        'post__in' => $offset_array,
        'paged' => $paged,
        'posts_per_page' => 5
    );
} else {
    // Args for single.php
    $args = array(
            'post_type' => 'post',
            'orderby' => 'date',
            'order' => 'DESC',
            'posts_per_page' => 5,
            'paged' => $paged
    );
}
$article_archive = new WP_Query($args);
$max_pages = $article_archive->max_num_pages;
if( $article_archive->have_posts() ) : while( $article_archive->have_posts() ) : $article_archive->the_post(); 
$has_image = get_the_post_thumbnail($post->ID,'thumbnail'); ?>
    <article class="group">
        <a class="anchor-overlay" href="<?php the_permalink(); ?>"></a>
        <?php if( $has_image ) { echo $has_image; } else { echo "<img src='/wp-content/themes/DCSFC/images/news-calendar/news/no-image.jpg' alt='No image' />"; } ?>
        <div>
            <h3><?php the_title(); ?></h3>
            <time datetime="dd/MM/YYYY"><?php echo get_the_date(); ?></time>
        </div>
    </article>
<?php endwhile; endif; 
wp_reset_postdata();

$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' => $max_pages
) );
?>

</div>


您能发布一个链接到您的站点和发生错误的页面吗?您好,Ceili。该站点目前位于受密码保护的dev子域上,但是如果您想向我发送IP地址,我可以临时授予您读取权限。其他人可以帮助吗?