开发者

WordPress: How to link the name of an author to that author's list of posts

I'm setting up a WordPress blog and I can't manage to link an author's name to the list of posts written by that a开发者_如何转开发uthor.

I am using this code:

written by <a href="<?php get_author_posts_url(); ?>"><?php the_author() ?></a>

But this gives me following error:

Warning: Missing argument 1 for get_author_posts_url(), called in /customers/zinneket.be/zinneket.be/httpd.www/wp-content/themes/zinneket/index.php on line 15 and defined in /customers/zinneket.be/zinneket.be/httpd.www/wp-includes/author-template.php on line 220 

Line 15 is of course the one copied above.

Does anyone know the right way to do this?

Thanks a lot.


The documentation makes it fairly clear that you need to provide an argument (to identify what author you're interested in).

From the looks of it, the_author_posts_link() is what you want to use.

Rule of thumb: the_ functions involve the current author/post/page/whatever, get_ functions require you to identify what author/post/page/whatever you are interested in.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜