dos3018 2018-05-21 20:16
浏览 125

在wordpress中自定义作者URL以显示用户信息

I am looking to use the author.php template to display information about each user.

I am running a loop to get users but when I click through I cant seem to grab any information relating to that user?

 <?php

 $members = get_users();

 foreach ( $members as $member ) { ?>

      <a href="<?php echo get_author_posts_url($member->ID); ?>">View User</a>

 <?php } ?>

How can I retrieve the firstname etc in the author.php file? For some reason it wont pull through to display anything. Thanks

  • 写回答

2条回答 默认 最新

  • drwdvftp423507 2018-05-21 23:15
    关注

    Because your $members array is empty on return call to get_users()

    You need to supply an argument for get_users() to be the matching filter criteria.

    评论

报告相同问题?

悬赏问题

  • ¥15 vhdl+MODELSIM
  • ¥20 simulink中怎么使用solve函数?
  • ¥30 dspbuilder中使用signalcompiler时报错Error during compilation: Fitter failed,求解决办法
  • ¥15 gwas 分析-数据质控之过滤稀有突变中出现的问题
  • ¥15 没有注册类 (异常来自 HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
  • ¥15 知识蒸馏实战博客问题
  • ¥15 用PLC设计纸袋糊底机送料系统
  • ¥15 simulink仿真中dtc控制永磁同步电机如何控制开关频率
  • ¥15 用C语言输入方程怎么
  • ¥15 网站显示不安全连接问题