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

Description

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

Usage

<?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 wp-includes/author-template.php

站长QQ:739696033 | 微信:bing-0719:Bcoder资源网 » wordpress根据ID获取作者文章页面


扫描二维码关注微信公众号:“bcoder-cn 声明:本站内容部分来自互联网,仅供交流学习之用,请勿作商业用途,版权归原作者所有。如果有侵犯到您的权益,请提供相关证明联系本站删除,谢谢合作!
赞 (0)
分享到:更多 ()

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址