#18859 closed enhancement (fixed)
Single theme template for custom post by slug
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 3.3 |
Component: | Themes | Keywords: | has-patch commit |
Focuses: | template | Cc: |
Description ¶
I was working on adding a custom template for an individual post in my custom post type and discovered that you could only make a single-{post-type}.php. This patch adds the ability to make single-{post-type}-{slug}.php
It's pretty straight forward, and only adds 1 line of code to wp-includes/theme.php
Commits (1)
- [34800] Add
single-{post_type}-{post_name}.php
to the top of the template hierarchy for single posts.… by @SergeyBiryukov 9 years ago
Pull Requests
- Loading…
Change History (17)
#2
@ Core Committer
13 years ago
- Component changed from Post Types to Template
- Keywords dev-feedback added; needs-testing removed
+1 from me.
Pages and Taxonomies are supporting slugs.
#4
@ Core Committer
13 years ago
- Version changed from 3.4 to 3.3
Version field indicates when the enhancement was initially suggested.
#6
@
13 years ago
I just updated the patch. The get_single_template() function was moved into wp-includes/template.php as of WordPress 3.4.
#7
@
12 years ago
I'd like this as well, or at the very least {post_type}-{slug}.php like pages get.
#9
@ Core Committer
9 years ago
- Keywords commit added; dev-feedback removed
- Milestone changed from Awaiting Review to 4.4
It shall be done.
Note: See
TracTickets for help on using
tickets.
wp-includes-theme.php.patch