wp教程:06如何循环输出文章列表

如何循环输出文章列表

have_posts() 是否有日志
license.txt 获取下一篇日志
readme.html 获取当前日志标题
wp-activate.php 获取当前日志链接
wp-blog-header.php 获取当前日志的内容

<?php if(have_posts()){
while(have_posts()){
the_post();
?>
<div id=”post-item”>
<div id=”post-title”>
<h2><a href=”<?php the_permalink() ?>”><?php the_title() ?></a></h2>
</div>
<div id=”post-centent”>
<?php the_content() ?>
</div>
</div>
<?php
}
}else{
echo “没有日志可以显示”;
} ?>  

查看更多在编辑器 点击more

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *