wp模板主体代码

WordPress 主体模板 PHP代码

  1. 复制代码
  2. <?php the_content(); ?> 日志内容
  3. <?php if(have_posts()) : ?> 确认是否有日志
  4. <?php while(have_posts()) : the_post(); ?> 如果有,则显示全部日志
  5. <?php endwhile; ?> 结束PHP函数”while
  6. <?php endif; ?> 结束PHP函数”if
  7. <?php get_header(); ?> header.php文件的内容
  8. <?php get_sidebar(); ?> sidebar.php文件的内容
  9. <?php get_footer(); ?> footer.php文件的内容
  10. <?php the_time(‘m-d-y’) ?> 显示格式为”02-19-08″的日期
  11. <?php comments_popup_link(); ?> 显示一篇日志的留言链接
  12. <?php the_title(); ?> 显示一篇日志或页面的标题
  13. <?php the_permalink() ?> 显示一篇日志或页面的永久链接/URL地址
  14. <?php the_category(‘, ‘) ?> 显示一篇日志或页面的所属分类
  15. <?php the_author(); ?> 显示一篇日志或页面的作者
  16. <?php the_ID(); ?> 显示一篇日志或页面的ID
  17. <?php edit_post_link(); ?> 显示一篇日志或页面的编辑链接
  18. <?php get_links_list(); ?> 显示Blogroll中的链接
  19. <?php comments_template(); ?> comments.php文件的内容
  20. <?php wp_list_pages(); ?> 显示一份博客的页面列表
  21. <?php wp_list_cats(); ?> 显示一份博客的分类列表
  22. <?php next_post_link(‘ %link ‘) ?> 下一篇日志的URL地址
  23. <?php previous_post_link(‘%link’) ?> 上一篇日志的URL地址
  24. <?php get_calendar(); ?> 调用日历
  25. <?php wp_get_archives() ?> 显示一份博客的日期存档列表
  26. <?php posts_nav_link(); ?> 显示较新日志链接(上一页)和较旧日志链接(下一页)
  27. <?php bloginfo(‘description’); ?> 显示博客的描述信息