[wp-trac] [WordPress Trac] #22314: Add singular.php to template hierarchy
WordPress Trac
noreply at wordpress.org
Wed Oct 31 13:56:31 UTC 2012
#22314: Add singular.php to template hierarchy
-------------------------------------------------+-------------------------
Reporter: chipbennett | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting
Component: Template | Review
Severity: normal | Version: 3.4.2
Keywords: has-patch needs-codex needs-testing | Resolution:
-------------------------------------------------+-------------------------
Comment (by chipbennett):
Replying to [comment:5 cais]:
> Replying to [comment:4 chipbennett]:
> > I think the consistency ''is'' the benefit, in large part. Also, to
me, it makes sense to have (the option to have) one template for
outputting an index of posts, and one template for outputting a single
post.
> Does not the `single` template serve to display a single post?
>
Not for ''all'' post types, whereas the archive-index pages for ''all''
posts types will fallback to `archive.php`. The exception for single-post
pages is the `page` post-type, which falls back directly to `index.php`.
All the rest - `post`, `attachment`, and custom post types - fall back to
`single.php`, then to `index.php`.
The analogy would be something like having `author.php` fallback directly
to `index.php`, while all other index-archive type pages falling back to
`archive.php`.
>
> I am not inherently against the idea of adding another template; this
discussion is meant more as a consideration of the current template choice
logic and if it should be adjusted to take into account what you are
suggesting your proposed `singular` template accomplish.
No worries. I'm just throwing the idea out there. If it gets implemented,
then great. If not, then at least the reasoning will be documented here,
should anyone ask about the (minor) inconsistency in the future.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22314#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list