我是WordPress主题开发方面的新手,我对用于在主页上显示我的帖子的WP功能有些怀疑:
<?php
if ( have_posts() ) :
// 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\', get_post_format() );
endwhile;
// Previous/next post navigation.
twentyfourteen_paging_nav();
else :
// If no content, include the "No posts found" template.
get_template_part( \'content\', \'none\' );
endif;
?>
直觉上我明白,只要有帖子,这些帖子就会显示在主页上。我的疑问与这一行代码有关:
get_template_part( \'content\', get_post_format() );
在阅读文档时,我觉得:(1)get_template_part: 将模板零件加载到模板中。所以我认为,通过这一行,我包括了一个用于显示帖子的模板部分(在我的主页中显示帖子的结构),对吗?
2) get\\u post\\u format()的具体操作是什么?