the_content() 不获取PHP文件content.php, 它只显示帖子的内容。同样地the_excerpt() 抓取一篇文章的摘录。
get_template_part 只需在您的主题中查找一个名为which的文件,并带有可选后缀。
get_template_part( \'content\' ); // content.php
get_template_part( \'content\', \'my_page\' ); // content-my_page.php
为了使多媒体资料、旁白等显示不同,请在单个中执行此操作。php
get_template_part( \'content\', get_post_format() );
它将指向
content-gallery.php,
content-aside.php, 等等,其回退时间为
content.php 如果未定义指定的文件。
Edit:你需要做的就是重组你的content-{post-format}.php 文件。在这些内部,使用the_content(), 并创建excerpt-{post-format}.php 然后可以使用的文件the_excerpt().
然后你打电话进来index.php 可能是get_template_part( \'excerpt\', get_post_format() ), 在您的single.php 是的get_template_part( \'content\', get_post_format() )