导航
用户登录
最新blog文章
搜索
在线用户
相关链接:
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) {
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);
- guoshuang 的blog
- 要发表评论,请先登录 或 注册
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 的blog
- 要发表评论,请先登录 或 注册
- 阅读全文
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 的blog
- 要发表评论,请先登录 或 注册
- 阅读全文
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 的blog
- 要发表评论,请先登录 或 注册
修改 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 的blog
- 要发表评论,请先登录 或 注册
wordpress 判断是否首页
我需要首页有特征
以便进行样式处理。
样式表内容为:
- guoshuang 的blog
- 要发表评论,请先登录 或 注册
最新评论
17 小时 37 分钟 前
2 天 16 小时 前
4 天 17 小时 前
5 天 9 小时 前
6 天 9 小时 前
1 周 15 小时 前
1 周 20 小时 前
1 周 20 小时 前
1 周 20 小时 前
1 周 20 小时 前