Make WordPress Core

Opened 3 years ago

Last modified 3 years ago

#54523 new enhancement

inherited custom template hierarchy

Reported by: grosfaignan's profile grosfaignan Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.8.2
Component: Themes Keywords:
Focuses: template Cc:



i would to make a feature request on worpdress.

it would be a good idea to give us the possibility to create custom template hierarchy in worpdress.

example, i would to create a profile page who inherit author template hierachy.
the possibiltiy to build something like a class who extends the author class would be usefull…

better... the possibility to create custom template hierarchy with custom rules could be a good idea...

Change History (2)

#1 @joyously
3 years ago

Templates apply to what is retrieved for display on the front end, which is from the post table, so if you make your author a post type you can use the existing template hierarchy to make a template for that post type. Template parts have a fallback mechanism, which is sort of like inheritance. It could be better than making a template because it affects only part of the page.

For related tickets about the template algorithm, see #48175 and #43597

Otherwise, authors in the user table are only shown by core in the admin, and not displayed with a template.

#2 @SergeyBiryukov
3 years ago

  • Component changed from General to Themes
  • Focuses template added

Hi there, welcome to WordPress Trac! Thanks for the ticket.

Just linking to some more potentially related tickets here: #12877, #13239, #14310, #21062, #22355.

Note: See TracTickets for help on using tickets.