当前位置:K88软件开发文章中心编程全书编程全书02 → 文章内容

wordpress根据ID获取作者文章页面

减小字体 增大字体 作者:佚名  来源:网上搜集  发布时间:2019-1-4 9:20:53

-->

Description

Gets the URL of the author page for the author with a given ID.

Usage

1
<?php?get_author_posts_url(?$author_id,?$author_nicename?);??>

Parameters

$author_id
(integer) (required) ID of the author whose URL should be retrieved.

Default: None
$author_nicename
(string) (optional) User nicename.

Default: empty

Return Values

(string)?
The URL to the author’s page.

Examples

Display the link of the author page for the author of the current post

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

Source File

get_author_posts_url() can be located in

1
wp-includes/author-template.php


wordpress根据ID获取作者文章页面