#41742 closed enhancement (invalid)
New conditional tag to decide if a post has a custom template
| Reported by: | danburzo | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Themes | Version: | 4.9 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: | template |
Description
Something like is_custom_template().
The rationale:
- it can be used in
template-loader.phpto aid in clarifying the Template Hierarchy for attachments, posts, and pages. - in a theme that wants to keep things DRY and redirects all template-xxx.php files to index.php, have a way to enquire if the post has a custom template — this unlocks alternative templating strategies (such as when using Timber).
Change History (4)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Was the closing intentional?
There are, however, is_page_template() and get_page_template_slug() functions that should cover this.