【问题标题】:How to create a profile page in Wordpress Multisite如何在 Wordpress Multisite 中创建个人资料页面
【发布时间】:2012-11-08 08:23:02
【问题描述】:

我找不到为 Wordpress 多站点网络下的所有用户创建前端个人资料页面的方法。如果可能,我还希望个人资料页面位于主站点上,而不是子站点上。我不想使用任何像 buddypress 这样的社交网络插件。我只想创建一个像 http://mainsite.com/profile/username 这样的页面

有没有办法做到这一点?

【问题讨论】:

    标签: wordpress


    【解决方案1】:

    也许您可以查看 Buddypress,它是 Wordpress 之上的一个社交层,能够满足您的需求(例如 http://mainsite.com/profile/username)。

    链接:http://buddypress.org/

    更具体地说,在 Buddypress 中,默认行为是 http://mainsite.com/members/username

    【讨论】:

      【解决方案2】:

      我注意到您已经编辑了问题,并且您正在寻找一种无需任何插件即可完成此任务的方法。 Wordpress 中有一系列标签来显示作者的数据。所以基本上你可以创建一个页面,然后使用 the_author_meta 标签。例如,下面的代码会回显一个用户的名字和姓氏,该用户的名字存储在$userID 中:

      <?php 
      $pagename = $userID;
      echo the_author_meta(user_firstname, $userID ); 
      echo the_author_meta(user_lastname, $userID ); 
      ?>
      

      如果您使用静态页面作为主页,请注意变量$pagename 为空,但您的情况并非如此。

      来源:https://codex.wordpress.org/Template_Tags/the_author_meta

      【讨论】:

        猜你喜欢
        • 2018-12-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-02-21
        • 2015-03-06
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多