【发布时间】:2016-04-25 11:53:53
【问题描述】:
网站博客here
尽管地址栏中出现了相应的第 2 页 URL,但当按下第 2 页时,博客页面底部的分页不会将内容更改为第 2 页帖子 - 此外,地址栏时第 2 页按钮不会显示为选中状态显示第 2 页 -
我用过this theme before on this website 安装时也存在分页问题,但由现在无法联系的创建者排序-
似乎这个主题的每次全新安装都有分页问题,直到编辑某些内容 -
只是补充一点,我不确定要发布哪些代码 sn-ps,所以如果有帮助,请告诉我哪些文件,但如果这是正确的代码,这里是来自 template-blog 的 sn-p。 php
<?php
if(is_category() || is_archive()){
/*get page with blog template set*/
$post_template_page_array = get_pages(array(
'post_type' => 'page',
'post_status' => 'publish',
'number' => 1,
'meta_key' => '_wp_page_template',
'meta_value' => 'template-blog.php',
'sort_order' => 'ASC',
'sort_column' => 'menu_order',
));
$post_template_page = $post_template_page_array[0];
echo wpb_js_remove_wpautop(apply_filters('the_content', $post_template_page->post_content));
global $post;
$post = $post_template_page;
setup_postdata($post);
} else {
if(have_posts()) : while (have_posts()) : the_post();
the_content();
endwhile; endif;
}
?>
非常感谢任何可以为此提出解决方案的人:)
【问题讨论】:
-
尝试刷新您的重写规则 - 转到永久链接设置并保存它们。
标签: php wordpress pagination