导航

用户登录

最新评论

聚合

聚合内容

在线用户

目前共有 0 位用户1 位游客在线。

相关链接:

wordpress

wordpress 代码

via http://webdesignledger.com/tips/13-useful-code-snippets-for-wordpress-development

修改 login 登录图片

function my_custom_login_logo() {
    echo '';
}

add_action('login_head', 'my_custom_login_logo');

手机检测

http://detectmobilebrowsers.mobi/

下载检测代码

include('mobile_device_detect.php');
$mobile = mobile_device_detect();

if ($mobile==true) {

由 guoshuang 于 周六, 06/12/2010 - 11:03 提交。

wp add_action

function email_friends($post_ID) {
$friends = 'bob@example.org, susie@example.org';
mail($friends, "sally's blog updated" , 'I just put something on my blog: http://blog.example.com');
return $post_ID;
}

add_action('publish_post', 'email_friends');

function echo_comment_id($comment_ID) {
echo "I just received $comment_ID";
}
add_action('comment_id_not_found','echo_comment_id', 10, 1);

http://codex.wordpress.org/Function_Reference/add_action

由 guoshuang 于 周二, 02/09/2010 - 10:11 提交。

Wordpress 头文件内容解释

link rel='canonical' href='http://pensee.net.cn/psd2html'

canonical 权威

在多个相似页面中,告诉搜索引擎,某某页是权威的,以便在输出搜索结果的时候,优先显示该页。(yahoo microsoft google 都支持这个开放标准)

比如 http://pensee.net.cn/psd2html?abc=123 这样的页面就可能不会被google收录(坊间有这种说法)

参考资料:

http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=1393...
http://www.mattcutts.com/blog/canonical-link-tag/

由 guoshuang 于 周二, 02/09/2010 - 09:28 提交。

site5 的15个sql 连接限制

太郁闷了,wordpress 首页都不止这个数,wp-admin 根本没打开就挂了,连进去看看、修改plugin 的机会都没有。

- Each application that interfaces with a database should be using its own individual MySQL database username to connect to the database. Sharing a single database user with multiple applications will result in you prematurely hitting the set user limit of 15.

已经这么做过了。好几个 sql account

由 guoshuang 于 周四, 08/07/2008 - 08:12 提交。

wordpress 的连接数

site5 主机提供的 sql 连接数有限制,导致 blog.guoshuang.com 经常出现

Error establishing a database connection

非常郁闷。在源代码中可以看到 aveo.guoshuang.com(只有 Akismet Google XML Sitemaps两个插件)

19 queries. 1.317 seconds.

好像 site5 的限制就是25个。:(

由 guoshuang 于 周三, 08/06/2008 - 08:38 提交。

修改 wordpress widgets 中 Tags 的代码

wordpress widgets 中 Tags 附近代码

Tags 别说包裹标签,后面连空格都没有。不好弄样式。

修改 wp-includes 目录的 widgets.php

function wp_widget_tag_cloud($args) {
...
$title = empty($options['title']) ? __('Tags') : $options['title'];

修改里面的 __('Tags') : 为 __('') : 或者其它。

由 guoshuang 于 周四, 06/26/2008 - 10:40 提交。

wordpress 判断是否首页

我需要首页有特征

以便进行样式处理。

样式表内容为:

由 guoshuang 于 周五, 05/30/2008 - 11:05 提交。
by guoshuang 2007 with drupal. RSS Sitemap