douhuan1905 2017-07-12 14:40
浏览 55

如何在WordPress上制作2个版本的作者页面

I want to make 2 different types of WordPress author profile. One is written in English and another is written in Japanese. To do this, I add a custom user field. For example, 'biography' for the English version and '経歴' for the Japanese version.

At admin > user panel, each author can register their info in both languages, then in the English version author page I display get_the_author_meta( 'biography_en', $userID );, and in the Japanese version author page I display get_the_author_meta( 'biography_ja', $userID );.

How could I connect a URL and 2 author page?

Currently, I display {root URL}/author/{username} for the English version. I want to display the Japanese version as {root URL}/author/{username}/ja. Is it possible?

  • 写回答

1条回答

  • doueta6642 2017-07-12 14:59
    关注

    You can use author.php template for adding rule

    if ( isset($_GET['lang']) && $_GET['lang']=='ja'){
     /*echo JA data*/
    }else{
     /*echo EN data*/
    }
    

    It will be work for url like {root URL}/author/{username}?lang=ja

    If you want '{root URL}/author/{username}/ja' need to use Rewrite API

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器