[wp-trac] [WordPress Trac] #22314: Add singular.php to template hierarchy
WordPress Trac
noreply at wordpress.org
Tue Apr 8 14:40:19 UTC 2014
#22314: Add singular.php to template hierarchy
-------------------------------------------------+-------------------------
Reporter: chipbennett | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting
Component: Themes | Review
Severity: normal | Version: 3.4.2
Keywords: has-patch needs-codex needs-testing | Resolution:
| Focuses: template
-------------------------------------------------+-------------------------
Comment (by knutsp):
+1
> is_singular() is currently the only template context conditional that
does not have such a corresponding template file.
This seems a very natural addition to the template hierarchy. This means
one can make a common template for all singular content and keep index.php
more dedicated to showing multiple content. singular.php has become a
"missing link" and it has to do with the introduction of custom post
types, a special front page and an alternative "blog" page (posts index),
and finally with the introduction of `is_singular()`.
When making a child theme for a (multi) site with (usually, a common theme
and) many custom post types I want to keep the templates collection as
simple as possible. First I create special templates for CPT archives, tax
archives and single CPTs with custom metadata. Other, more plain content,
like posts, pages, other CPTs in singular form should be able to share a
template file, sometimes with simple conditionals for the display, or not,
of standard metadata (author, date etc).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/22314#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list