Make WordPress Core

Opened 6 years ago

Closed 4 years ago

Last modified 4 years ago

#45347 closed enhancement (wontfix)

Add extra template lookup by author role

Reported by: andreiigna's profile andrei.igna Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Themes Keywords:
Focuses: template Cc:

Description

Themes can display an author page, but it's always only a generic one.

At the moment it's a tricky process to make different templates for different authors (except targeting them by specific IDs or usernames) and here is a idea:

Add templates for user/author role, with author templates hierarchy looking like this:

  • author-{nicename}.php
  • author-{ID}.php
  • author-{role}.php - adding support for author-administrator.php, author-editor.php and author-{custom-role}.php
  • author.php
  • index.php

The extra template lookup can be added in get_author_template function and would make it easier for theme developers to prepare templates without specifying specific user info (IDs or usernames)

Change History (2)

#1 @Mista-Flo
4 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

Hum, it should be handled inside author.php IMO. You can do a role switch and then load the template you want. It would be a bit overkill to add all this hierarchy IMO.

#2 @desrosj
4 years ago

  • Component changed from Users to Themes
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.