WordPress.org

Make WordPress Core

Opened 9 months ago

Last modified 3 weeks ago

#46490 accepted defect (bug)

Clarify documentation that page-templates folder is not necessary for theme templates

Reported by: skorasaurus Owned by: williampatton
Milestone: Awaiting Review Priority: normal
Severity: minor Version:
Component: Themes Keywords:
Focuses: docs Cc:
PR Number:

Description

Hi,

While browsing Page Templates in the Theme Handbook to refresh myself on recommend theme structures and page templates; I became a little confused and suggest some clarification for users.

The File Organization of Page templates section initially confused me because it states "WordPress recognizes the subfolder page-templates." This is misleading and can give readers the impression that WordPress would only recognize that specific folder name.

As of WordPress 3.4, any subdirectory folder can be used (as far as I know).

I suggest rephrasing it something like to be can be placed in any subdirectory but suggest a folder like page-templates or templates. You cannot use a 2nd-level subdirectory (e.g. pages/templates/).

Change History (2)

#1 @iamdmitrymayorov
9 months ago

Might also be helpful to mention that if, for example, the template was in the root directory of the theme and some pages were using it, when you move it to a subdir, those pages will fall back to the default page template.

#2 @williampatton
3 weeks ago

  • Owner set to williampatton
  • Status changed from new to accepted

Thank you for pointing this out. I'll grab the ticket and look at getting some updated text into those docs pages. This may be better off as a meta trac ticket but let's look at getting this sorted anyways :)

Note: See TracTickets for help on using tickets.