WordPress修改笔记

1.修正Wordpress中文Tag不能正常访问的问题。

让WordPress在对其他内容使用Permalink的时候,对tag不使用,而使用链接2的QueryString模式发送中文编码。

<span style="font-size: small;">—————————————————————
function get_tag_permastruct() {
if (isset($this-&amp;gt;tag_structure)) {
return $this-&amp;gt;tag_structure;
}
<span style="color: #ff0000;">if (empty($this-&amp;gt;permalink_structure)) { //-----this line need change------</span>
$this-&amp;gt;tag_structure = ”;
return false;
}

—————————————————————
将上面标记的第五行替换为:
—————————————————————

<span style="color: #ff0000;">if (! empty($this-&amp;gt;permalink_structure)) { //修改if()的判断条件</span></span>

原文连接:http://www.ctusky.com/c2009/02/46_chinese-tags-solution-wordpress-error.html

2.修改主题widget中分类显示方式为横排。

style.css文件中加入

li.cat-item{
width:33%;float:left;list-style:none;line-height:23px;margin:0;
}
.widget_categories ul{
overflow: hidden;
}

3.修改评论回复为Ctrl+Enter提交回复。

在模板的comments.php中查找:

<form action="<?php echo get_option('siteurl'); ?>;
/wp-comments-post.php" method="post" id="commentform" name="commentform">; <?php if ( $user_ID ) : ?>

如果你的form标签中没有name=”commentform”属性,那么请加上。

再往下拉一点,你可以看到类似的两行:

<textarea name="comment" id="comment" cols="55" rows="10" tabindex="4">
</textarea>
<input type="submit" id="submit" tabindex="5" value="提交留言" />

如果textarea标签上没有id属性,请按照上面的内容加上。如果在第二行中发现name=”submit”,将之删除。如果你发现还是不行,把id=”submit”改为id=”submitit”,这样肯定是可以了。

最后查找</form>

在其后边增加

<script type="text/javascript">

var commenttextarea = document.getElementById('comment');

commenttextarea.onkeydown = function quickSubmit(e) {

if (!e) var e = window.event;

//alert(e.keyCode);

if (e.ctrlKey &amp;&amp; e.keyCode == 13){

//alert('good');

document.getElementById('commentform').submit();

}

};

</script>

 

原文链接:http://bingu.net/512/wordpress-hack-use-ctrl-enter-submit-comment/

4.修改主题index.php以实现WP KIT CN的首页自动摘要功能

<?php the_content(); ?>

替换为

<?php

if (is_single() or is_page())

{the_content();}

else

{the_excerpt();}

?>

方法来源:http://myfairland.net/wordpress-excerpt/#edit-theme

4.停止使用部分插件。

WP-MulticolLinksWP-PluginsUsedWP User RegistrationLinkedList@ ReplySubscribe To Comments

updata: ©FeedMagicPostsView Plugin

5.启用部分插件。

WP Kit CNShare This 中文WordPress Related PostsWP-PageNaviWP Cleaner

updata:WP-PostViewsSimple Feed Copyright

updata@2009-3-19:WP-Note

6.根据我爱水煮鱼的文章:整合Google自定义搜索到WordPress中,修改博客搜索方式为Google自定义搜索.

7.根据我爱水煮鱼的文章:怎样缓存Sidebar,将Sdiebar缓存,提高访问速度。

8.修改Sidebar友情链接方式为双列显示。

根据xiaorszwordpress 友情链接随机、分列显示修改。

style.css中加入

.xoxo li{

background:transparent none repeat scroll 0 50%;

float:left;

padding-left:0;

width:50%;

}

此文用以备忘,随时更新!

Last Updata: 2009-3-10  01:32

Last Updata: 2009-3-13  20:53

Last Updata: 2009-3-19  23:20

发表回复