所以我在单词页面上设置了类别页面。但循环是用previous_post()
php函数编写的,我无法弄清楚如何删除它而不会导致致命的php代码错误。下面是代码的推送。
<?php
/**
* The template for displaying Category pages
*
*/
?>
<?php get_header(); ?>
<div id="archive_content">
<?php if ( have_posts() ) : ?>
<?php
// Start the Loop.
while ( have_posts() ) : the_post(); {
/*
* Include the post format-specific template for the content. If you want to
* use this in a child theme, then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part( 'content', 'exchange-category' ); }
endwhile;
// Previous/next page navigation.
previous_post();
else :
// If no content, include the "No posts found" template.
get_template_part( 'content', 'none' );
endif;
?>
</div><!-- #content -->
</section><!-- #primary -->
<?php
get_footer(); ?>
例如,如果您转到:http://www.bluestarnj.com/?it_exchange_category=d-bc,它会显示我查看的上一篇文章(产品)。我无法弄清楚如何正确设置循环,以便它所做的只是调用我的content-exchange-category.php页面,而wordpress codex以这种方式非常混乱。
由于 Baroti