2012-09-07 30 views
1

我有一个问题,列出给定的作者在author.php 所有职位所有用户,除管理员确定。WordPress的作者Page 404

http://somedomain.com/author/MyUser - 行(非管理员用户!)
http://somedomain.com/author/?author=1 - 行(管理员ID = 1)

http://somedomain.com/author/admin - 404
http://somedomain.com/author/User.Admin - 404
http://somedomain.com/author/AdminNickName - 404

wp_query如下:

$curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author')); 

$args = array('post_type' => 'post', 'author' =>$curauth->ID, 'posts_per_page' => 10); 
$wp_query = new WP_Query($args); 

任何解决方案?非常感谢!

+0

您的管理员用户是否有帖子?安全提示重命名管理员用户,每个黑客都试图先破解“管理员”帐户。如果你有'admin_guy',至少有点难以弄清楚。 http://mrwweb.com/wordpress-tip-dont-use-admin-seriously/ – janw

+0

尝试禁用所有插件,然后重试。 – janw

+0

@janw - 没有插件,同样的问题。任何建议或解决方法? – Iladarsda

回答

0

我有完全相同的问题。以下是解决方案。 (我不确定这是为什么可行,但确实如此。)

编辑您的Wordpress数据库表wp_users。找到您的管理员帐户并编辑“user_nicename”字段。输入你的登录名(或一些URL友好的字符串)并保存。

就是这样。在我的这个专栏中,原始值是“Trevor Gehman”,作者页面的网址是/ author/TrevorGehman /,它返回了404。我将值改为“trevorgehman”,然后URL变成/ author/trevorgehman /它的工作!

http://wphacks.com/change-author-archive-permalink/