Jun 22

把这段代码放到 theme 里的 functions.php 文件:

function theme_pre_comment_post( $c) {
	$c['comment_content'] = htmlspecialchars($c['comment_content']);
	return $c;
}
add_filter( 'preprocess_comment', 'theme_pre_comment_post', '', 1);

Written by ideawu at 2010-06-22 13:54:47 | tags:

Apr 23

今天无意中发现一个mac风格的Wordpress主题 i2theme, 觉得很好看, 于是Download下来, 改一下宽度, 就用上了. 以前也发现别人用过这样的mac主题.

mac的视觉效果确实非常优雅, 有机会要买一个苹果电脑用用.

Written by ideawu at 2010-04-23 21:59:16 | tags:

Apr 09

Category widget with an exclude field, that you can set ‘Uncategoriezed’ not being shown. Based on default Wordpress category widget, so it acts just like that one.

In widget setting page, add “ideawu_category” widget to Sidebar, then type “1″ into the “Exclude” form field that save. Category ids are seperated by comma mark.

Download: ideawu_category.zip

Written by ideawu at 2010-04-09 12:16:04 | tags: ,

Mar 23

不使用Permalink也能编辑Wordpress slug

编辑 wp-admin/js/page.js 和 wp-admin/js/post.js, 将如下两行注释掉.

//jQuery(‘#slugdiv’).hide();
//jQuery(‘#pageslugdiv’).hide();

autosave和revisions

define( ‘AUTOSAVE_INTERVAL’, 99999 ); // seconds
define( ‘WP_POST_REVISIONS’, 0 ); // disable revisions

从wp-admin/post-new.php和page-new.php中删除”wp_enqueue_script(‘autosave’);”;

关闭恼人的插件更新提示

在wp-admin/menu.php中搜索”update_plugins”, 你就知道怎么修改了.

显示文章数量为0的分类

就算没有文章, 分类也应该显示, 而不应该隐藏.

修改wp-includes/category-template.php的wp_list_categories可带参数hide_empty.

Written by ideawu at 2010-03-23 14:45:36 | tags:

Feb 26

我的简历页面(http://www.ideawu.net/resume.php)更新后, 这两个搜索引擎都没有来更新, 还是以前的内容, 不知道什么原因, 所以发篇日志试下. Wordpress的SEO做得还是很好.

Google百度搜索引擎快来啊!

Written by ideawu at 2010-02-26 11:58:37 | tags:

Jan 04

假设你原来的前缀是”wp_”, 将数据库中所有表都改名一遍.

然后修改config.php:

$table_prefix = ‘PREFIX_’;

直接修改数据库表 wp_usermeta, 将meta_key带前缀”wp_”的行, 全部修改为”PREFIX_”前缀(你的新前缀).

直接修改数据库表 wp_options, 将option_name=wp_user_roles的那一行, 修改为option_name=PREFIX_user_roles.

如果没有做这些修改, 会在后台管理页面遇到错误提示”You do not have sufficient permissions to access this page.”或”您没有足够的权限访问本页面”.

Written by ideawu at 2010-01-04 17:59:34 | tags: