我有一个wordpress,我想用一个php LOOP来浏览我的帖子,这样我就可以收到我所有的帖子了,问题是我只想要帖子的标题,内容和日期...
<?php
while ( have_posts() ) : the_post();
get_template_part( 'content', get_post_format() );
echo "<br/><br/>";
endwhile;
?>
这是循环的通用代码,我尝试搜索该get_post_format()
函数,因此我只能得到所需的信息,但是没有人可以帮忙吗?
在循环中使用the_title()
,the_date()
和the_content()
。
the_title(); //displays post title
the_content(); //displays post content
the_date(); //displays post date
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句