您现在的位置是:首页 > 网站制作 > WordpressWordpress
WordPress函数the_author_meta()
杰帅2023-08-06【Wordpress】人已围观
简介the_author_meta() 显示用户资料的函数,如果该函数在 the_loop 中,那么将显示loop中的用户资料,如果在 the_loop 之外使用,必须指定用户ID才能输出内容。
介绍
the_author_meta() 显示用户资料的函数,如果该函数在 the_loop 中,那么将显示loop中的用户资料,如果在 the_loop 之外使用,必须指定用户ID才能输出内容。
使用
<?php the_author_meta( $field, $userID ); ?>
参数
$field
(string) Field name for the data item to be displayed. Valid values:
- user_login
- user_pass
- user_nicename
- user_email
- user_url
- user_registered
- user_activation_key
- user_status
- display_name
- nickname
- first_name
- last_name
- description
- jabber
- aim
- yim
- user_level
- user_firstname
- user_lastname
- user_description
- rich_editing
- comment_shortcuts
- admin_color
- plugins_per_page
- plugins_last_view
- ID
$userID
(integer) (optional) If the user ID fields is used, then this function display the specific field for this user ID.
Default: false
示例
显示作者的 AIM。
<p>This author's AIM address is <?php the_author_meta('aim'); ?></p>
显示指定用户的 Email 地址。
<p>The email address for user id 25 is <?php the_author_meta('user_email',25); ?></p>
Tags:wordpress函数 WordPress建站
很赞哦! ()
相关文章
随机图文
wordpress 上传的图片不显示的问题 base64,data:image/gif
wp_reset_postdata 和 wp_reset_query 的作用与区别
什么时候使用wp_reset_query,什么时候用wp_reset_postdata?WordPress 页面模板(Page Template)下拉列表不显示的原因及解决方法
WordPress 的自定义页面模板是一个非常强大好用的功能,使用它新建一些静态页面(Page),添加上一些数据调用的函数,再在网页上做一个导航连接到对应的页面就可以实现很多自定义的功wordpress发布文章HTML标签被自动过滤掉该如何处理?
wordpress发布文章时很多html标签都会自动过滤掉,造成了文章中无法添加<style></style><script></script>等标签。那么该如何如何处理呢? 解决方法一: 将wp-includes文件夹下
文章评论
本站推荐
标签云
猜你喜欢
- WordPress站点健康问题“已检测到活动的PHP会话”解决办法 - 搬主题
- WordPress 函数do_action()详解和应用举例
- WordPress过滤器(Filters):apply_filters和add_filter 用法和实例
- 几种流行的SaaS建站平台系统
- WordPress代码判断手机移动设备并跳转手机版
- WordPress数据库:wp_usermeta数据表详解及使用
- 解锁创意灵感:打造属于创意人士的WordPress网站
- WordPress优化:wp_head和remove_action函数
- wordpress获取当前分类下所有文章列表
- 如何将WordPress文章迁移到Shopify:使用WP All Export插件的完整指南