get_author_posts_url 通过指定ID获取作者页面的URL

Posted in:
Update time:2020-10-27

函数描述

通过指定 ID 获取作者存档页面的 URL。我们可以通过此函数获取作者发表的所有文章的存档页面URL。

Usage

get_author_posts_url( $author_id, $author_nicename );

parameters

parametersdata typeRequired or notdescriptivedefault value
$author_idinteger (math.)be作者IDnot have
$author_nicenamestring (computer science)clogged作者昵称empty string

return value

(string) 作者文章存档页面的URL

usage example

显示当前文章的作者页面的链接。

<a href="/en/</?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author(); ?></a>

We offer WordPress Themes and Plugins Custom Development Services

This site has long undertaken WordPress themes, plugins, WooCommerce-based store mall development business. We have 10 years of experience in WordPress development, if you want to Developing Websites with WordPress, please contact WeChat: iwillhappy1314 or email: amos@wpcio.com for inquiries.

发表回复

Your email address will not be published. 必填项已用 * 标注

*