【发布时间】:2018-09-07 04:33:20
【问题描述】:
我正在尝试创建一个 wordpress 主题,但我无法在实时版本上进行分页。在本地主机上它按预期工作,但在实时版本上它每次都会提供 404 页面。我知道关于这个主题有很多答案,但我无法解决我的问题。我已经尝试过以下主题,还有很多其他主题,但没有一个对我有帮助:
我想知道你们是否可以帮助我弄清楚我在这里缺少什么。我正在尝试在索引文件(我的博客页面)上显示我的导航面板。
get_header(); ?>
<div id="primary" class="container">
<main id="main" class="col-xs-12">
<h3 class="title text-center">Notícias:</h3>
<?php
global $wp_query;
query_posts(
array_merge( array(
'post_type' => 'news',
'orderby' => 'date',
'order' => 'DESC',
'posts_per_page' => 3
),$wp_query->query)
);
while($wp_query->have_posts()) :
$wp_query->the_post();
get_template_part('template-parts/content', 'news');
endwhile;
?>
<div class="text-center paginate">
<?php
if(function_exists('wp_paginate')):
wp_paginate();
endif;
?>
</div> <!-- .tect-center / Paginate-->
<?php wp_reset_postdata(); ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_footer();
现在我正在使用Wp-paginate 插件,但使用paginate_links() 函数会给我同样的错误,但它们都在本地主机上工作。对于分页链接,我使用了文档中的示例:
https://codex.wordpress.org/Function_Reference/paginate_links.
请问有人能帮我吗?
【问题讨论】:
-
尝试重置永久链接。
-
请重置永久链接
标签: php wordpress wordpress-theming