我正在玩弄模板层次结构。我上传了2012年股票主题并删除了页面。php和single。php。我发现,当我访问一篇博客帖子并单击帖子回复链接留下评论时,评论表单不会显示。所以我将comments\\u template()函数从single中复制了出来。php并将其粘贴到内容中。php中的is\\u single conditional如下所示
<?php if ( is_single() ) : ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php else : ?>
<h1 class="entry-title">
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( \'Permalink to %s\', \'twentytwelve\' ), the_title_attribute( \'echo=0\' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
</h1>
//added the comments template here
comments_template( \'\', true);
<?php endif; // is_single() ?>
因此,我希望注释模板能够显示出来,但事实并非如此。然而,当我将is\\u single条件添加到索引时,它确实出现了。php循环为什么它在
get_template_part( \'content\', get_post_format());