最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

author - How to create page for user?

programmeradmin4浏览0评论

I'm using author.php to display all user and their info. I would like to add a separate page like this : domain/users/user_name/ABOUT

Is there a way to add a page (ABOUT) and retrieve info of that user in that page ?

I'm using author.php to display all user and their info. I would like to add a separate page like this : domain/users/user_name/ABOUT

Is there a way to add a page (ABOUT) and retrieve info of that user in that page ?

Share Improve this question asked Nov 30, 2019 at 22:33 memsmems 7312 bronze badges 1
  • This may be possible with rewrite rule endpoints – Tom J Nowell Commented Dec 1, 2019 at 0:50
Add a comment  | 

1 Answer 1

Reset to default 0

Is there a reason why you don't just want to make the "author archive" a page and list them all on the page with a shortcode ? If that's an option, simply put your single author template in author.php

Author templates - Template hierarchy

If not, you could take your current template (that you've put in author.php) and move it to archive.php with a conditional tag, only showing your authors if the query is for post type authors .

Conditional tags - A post type

But any way you do it, I don't think you will get the permalink structure you're asking for:

domain/users/user_name/ABOUT

But rather : All users (using the archive page to list all authors): domain/archive.php Single user (or about-page): domain/author.php

If you instead were to use a simple page and a shortcode you could get: All authors: domain/users Single user: domain/author.php

发布评论

评论列表(0)

  1. 暂无评论