wordpress文章页面(single.php)通常使用到的函数如下:
<?php
/**
* 文章详情页面模板
*
* @package WordPress
* @author by shouce.ren
*/
get_header(); ?><!—- 加载头部模板header.php —->
<div id="primary" class="site-content">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?><!—- 读取文章 —->
<nav class="nav-single">
<div class="prev"><?php previous_post_link('上一篇:%link') ?></div>
div class="next"><?php next_post_link('下一篇:%link') ?></div>
</nav
<?php comments_template( '', true ); ?>?><!—- 加载评论模板comments.php —->
<?php endwhile; // 循环结束 ?>
</div><!—- #content —->
</div><!– #primary –>
<?php get_sidebar(); ?><!—- 加载侧边栏模板sidebar.php —->
<?php get_footer(); ?><!—- 加载底部模板footer.php —->