覆盖类别存档输出的默认设置(二十页)


Override default setting for category archive output (in twentytwelve)

我在一个自定义类别模板中有这个片段,它输出该类别的最后X篇文章。

<?php if ( have_posts() ) : ?>
    <?php while ( have_posts() ) : the_post(); get_template_part( 'content', get_post_format() );   endwhile; twentytwelve_content_nav( 'nav-below' ); ?>
<?php else : ?>
    <?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>

问题是,这会将帖子作为摘录输出。。如何在不影响所有其他循环的情况下将其更改为the_content()?我只需要把帐篷放在这里。

我需要手动输出标题,然后是日期,然后是作者,然后是the_content()吗?或者我可以替换上面片段中的内容吗?

根据您提供的内容,您似乎已经自定义了content.php模板。

要只显示类别页面的内容,请看,您需要添加该条件。由于你没有添加content.php的代码,我不能确切地说在哪里添加,但你必须做一些类似的事情

if(is_category()) {
  the_content();
}else{
  the_excerpt();
}