WordPress 2.7 Theme Changes
From http://ericulous.com/2008/10/27/wordpress-27-theme-changes/
A comparison of the Default wordpress theme (v2.7 vs v2.6).中文内容是我写的~
Old: div class=”post” New:div < ?php post_class() ?>
Found: multiple files
Display the classes for the post div e.g class=”sticky category-uncategorized tag-untagged”. Using this function will break your theme on older version of Wordpress (< v2.7). Not using this, however, you are unable to style your individual sticky/category/tag post. Workaround would be to do a if function_exists() check.
v2.7提供了日志固顶功能,因此提供了这个API,需要对固顶日志进行自定义的记得加上。
Old: <?php include (TEMPLATEPATH . '/searchform.php'); ?> New: < ?php get_search_form(); ?>
Found: multiple files
Will first attempt to locate the searchform.php file in either the child or the parent, then load it. If it doesn’t exist, then the default search form will be displayed. Probably can safely ignore this for now because if you use this template function, your theme will not be backward compatible to older version of Wordpress (< v2.7).
搜索框的调用,比以前的include引用好多了,现在可以跟header,footer一样使用 get_search_form()调用了。
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="< ?php bloginfo('atom_url'); ?>" />
Found: header.php
Add Atom feed link
随着时代的进步,也该加上Atom Feed了,有没检查一下你的Blog Theme,有没加Atom Feed呢?哈哈,nwhy.org的没有加……
New:< ?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
Found: header.php
Add script for threaded comments if current page is a single post, is a page, or is an attachment.
v2.7支持comment的嵌套回复,我想这是v2.7的一个大新闻吧,这一点就是针对这一功能的。
不过大家都说WP的嵌套回复不好用……
--------------------------------------------------------------------------------------------
comments.php: Major code changes. I think this post on Wordpress 2.7 Comments Enhancements will do a better job of explaining the changes.
没错,comments.php文件做了很大的修改,像nwhy.org当前使用的theme就没有嵌套回复功能……