Skip to content

WP用户日志页面404错误的解决办法

2011 九月 22

博客之前一直有一个404错误,一直没怎么关注。今天修改数据库搞定此问题了。

另外说一下,simpledark用的取用户日志链接的函数为the_author_posts_link,此函数目前已经处于deprecated状态。官方建议用 get_author_posts_url(); 替代之。

the_author_posts_link has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. This function is deprecated since 2.1 use get_author_posts_url() instead.

由于我显示名称(display_name)用的是中文的“荒野无灯” ,而get_author_posts_url();用来组建URL是取wp_users表中的user_nicename字段的,由于我的user_nicename字段默认和display_name 一样,因此组建的URL自然也是中文的。不过貌似WP的rewrite正则匹配没有考虑到中文用户,因此,最简单的办法就是修改user_nicename字段为英文吧,中间不要有空格和其它奇怪字符。

1
UPDATE `my_wb_db`.`wp_users` SET `user_nicename` = 'HuangYeWuDeng' WHERE `wp_users`.`ID` =你的用户ID;

OK,搞定。
现在的用户链接已经是:
http://ihacklog.com/author/HuangYeWuDeng

喜欢这篇文章吗?

请订阅本站 RSS feed填写您的邮件地址,订阅我们的精彩内容:,欢迎点击这里捐赠以支持荒野无灯转播到腾讯微博 转播到腾讯微博

作者:荒野无灯
出处:Hacklog【Hacklog】

声明: 本站遵循 署名-非商业性使用-相同方式共享 3.0 共享协议. 转载请注明转自Hacklog【荒野无灯weblog】

本文链接: http://ihacklog.com/?p=4843

One Response Post a comment
  1. 九月 24, 2011

    抢了沙了。哈哈。。。

Leave a Reply

Allowed Tags - You may use these HTML tags and attributes in your comment.

<a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <q cite=""> <strong>

 :wink:  :-|  :-x  :twisted:  :)  8-O  :(  :roll:  :-P  :oops:  :-o  :mrgreen:  :lol:  :idea:  :-D  :evil:  :cry:  8)  :arrow:  :-?  :?:  :!:

Note: You may use basic HTML in your comments. Your email address will not be published.

Subscribe to this comment feed via RSS